parent
72b4402c4e
commit
9e33b3d52f
@ -0,0 +1,31 @@ |
||||
# ---> Vim |
||||
# Swap |
||||
[._]*.s[a-v][a-z] |
||||
!*.svg # comment out if you don't need vector files |
||||
[._]*.sw[a-p] |
||||
[._]s[a-rt-v][a-z] |
||||
[._]ss[a-gi-z] |
||||
[._]sw[a-p] |
||||
|
||||
# Session |
||||
Session.vim |
||||
Sessionx.vim |
||||
|
||||
# Temporary |
||||
.netrwhist |
||||
*~ |
||||
# Auto-generated tag files |
||||
tags |
||||
# Persistent undo |
||||
[._]*.un~ |
||||
|
||||
subprojects |
||||
builddir |
||||
ttassets |
||||
backup |
||||
*.exe |
||||
*.dll |
||||
*.world |
||||
coverage |
||||
coverage/* |
||||
.venv |
@ -0,0 +1 @@ |
||||
set makeprg=meson\ compile\ -C\ . |
@ -0,0 +1,49 @@ |
||||
all: build |
||||
|
||||
reset: |
||||
ifeq '$(OS)' 'Windows_NT' |
||||
powershell -executionpolicy bypass .\scripts\reset_build.ps1
|
||||
else |
||||
sh -x ./scripts/reset_build.sh
|
||||
endif |
||||
|
||||
build: |
||||
meson compile -j 10 -C builddir
|
||||
|
||||
release_build: |
||||
meson --wipe builddir -Db_ndebug=true --buildtype release
|
||||
meson compile -j 10 -C builddir
|
||||
|
||||
debug_build: |
||||
meson setup --wipe builddir -Db_ndebug=true --buildtype debugoptimized
|
||||
meson compile -j 10 -C builddir
|
||||
|
||||
tracy_build: |
||||
meson setup --wipe builddir --buildtype debugoptimized -Dtracy_enable=true -Dtracy:on_demand=true
|
||||
meson compile -j 10 -C builddir
|
||||
|
||||
run: build |
||||
ifeq '$(OS)' 'Windows_NT' |
||||
powershell "cp ./builddir/besos.exe ."
|
||||
./besos
|
||||
else |
||||
./builddir/game
|
||||
endif |
||||
|
||||
debug: build |
||||
gdb --nx -x .gdbinit --ex run --args builddir/besos
|
||||
|
||||
debug_run: build |
||||
gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/besos
|
||||
|
||||
clean: |
||||
meson compile --clean -C builddir
|
||||
|
||||
debug_test: build |
||||
gdb --nx -x .gdbinit --ex run --args builddir/runtests -e
|
||||
|
||||
win_installer: |
||||
powershell 'start "C:\Program Files (x86)\solicus\InstallForge\bin\ifbuilderenvx86.exe" scripts\win_installer.ifp'
|
||||
|
||||
coverage_report: |
||||
powershell 'scripts/coverage_report.ps1'
|
@ -0,0 +1,20 @@ |
||||
{ |
||||
"sounds": { |
||||
"ui_click": "assets/sounds/ui_click.ogg", |
||||
"ui_hover": "assets/sounds/ui_hover.ogg", |
||||
"blank": "assets/sounds/blank.ogg" |
||||
}, |
||||
"sprites": { |
||||
}, |
||||
"graphics": { |
||||
"smooth_textures": true |
||||
}, |
||||
"theme": { |
||||
"NOTE": "colors are in assets/palette.json", |
||||
"padding": 3, |
||||
"border_px": 1, |
||||
"text_size": 20, |
||||
"label_size": 20, |
||||
"font_file_name": "assets/text.otf" |
||||
} |
||||
} |
@ -0,0 +1,81 @@ |
||||
{ |
||||
"color": { |
||||
"transparent": [100, 100, 100, 100], |
||||
"BAD": [255, 0, 0] |
||||
}, |
||||
"gui/theme": { |
||||
"black": [0, 0, 0, 255], |
||||
"dark_dark": [10, 10, 10, 255], |
||||
"dark_mid": [30, 30, 30, 255], |
||||
"dark_light": [60, 60, 60, 255], |
||||
"mid": [100, 100, 100, 255], |
||||
"light_dark": [150, 150, 150, 255], |
||||
"light_mid": [200, 200, 200, 255], |
||||
"light_light": [230, 230, 230, 255], |
||||
"white": [255, 255, 255, 255], |
||||
"fill_color": "gui/theme:dark_mid", |
||||
"text_color": "gui/theme:light_light", |
||||
"bg_color": "gui/theme:mid", |
||||
"border_color": "gui/theme:dark_dark", |
||||
"bg_color_dark": "gui/theme:black" |
||||
}, |
||||
"map/theme": { |
||||
"black": [0, 0, 0, 255], |
||||
"dark_dark": [10, 10, 10, 255], |
||||
"dark_mid": [30, 30, 30, 255], |
||||
"dark_light": [60, 60, 60, 255], |
||||
"mid": [100, 100, 100, 255], |
||||
"light_dark": [150, 150, 150, 255], |
||||
"light_mid": [200, 200, 200, 255], |
||||
"light_light": [230, 230, 230, 255], |
||||
"white": [255, 255, 255, 255] |
||||
}, |
||||
"items/fg": { |
||||
"flame": "map/theme:white", |
||||
"potion": "map/theme:white" |
||||
}, |
||||
"enemies/fg": { |
||||
"player": "map/theme:white", |
||||
"gold_savior": "map/theme:white", |
||||
"knight": "map/theme:white", |
||||
"axe_ranger": "map/theme:white", |
||||
"rat_giant": "map/theme:white", |
||||
"spider_giant": "map/theme:white" |
||||
}, |
||||
"tiles/fg": { |
||||
"floor_tile": "map/theme:mid", |
||||
"wall_plain": "map/theme:dark_mid", |
||||
"wall_moss": "map/theme:dark_light", |
||||
"ceiling_black": "color:transparent", |
||||
"lava_floor": [200, 100, 100], |
||||
"gray_stone_floor_light": [40, 60, 180], |
||||
"wood_wall": "map/theme:dark_mid" |
||||
}, |
||||
"tiles/bg": { |
||||
"floor_tile": "map/theme:dark_dark", |
||||
"wall_plain": "map/theme:dark_dark", |
||||
"wall_moss": "map/theme:light_dark", |
||||
"ceiling_black": "color:transparent", |
||||
"lava_floor": "map/theme:dark_dark", |
||||
"gray_stone_floor_light": "map/theme:dark_mid", |
||||
"wood_wall": "map/theme:dark_dark" |
||||
}, |
||||
"devices/fg": { |
||||
"stairs_down": [24, 205, 189], |
||||
"stairs_up": [24, 205, 189], |
||||
"tripwire": [24, 205, 189], |
||||
"barrel": [150, 100, 189], |
||||
"grave_stone": [32, 123, 164], |
||||
"dead_body": [32, 123, 164], |
||||
"dead_body_lootable": [32, 123, 164] |
||||
}, |
||||
"devices/bg": { |
||||
"stairs_down": [24, 205, 189], |
||||
"stairs_up": [24, 205, 189], |
||||
"tripwire": [24, 205, 189], |
||||
"barrel": [150, 100, 189], |
||||
"grave_stone": [24, 205, 189], |
||||
"dead_body": [24, 205, 189], |
||||
"dead_body_lootable": [24, 205, 189] |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
{ |
||||
"ui_shader": { |
||||
"file_name": "assets/shaders/ui_shader.frag", |
||||
"type": "fragment" |
||||
}, |
||||
"ERROR": { |
||||
"file_name": "assets/shaders/ui_error.frag", |
||||
"type": "fragment" |
||||
} |
||||
} |
@ -0,0 +1,18 @@ |
||||
uniform vec2 u_resolution; |
||||
uniform vec2 u_mouse; |
||||
uniform float u_duration; |
||||
uniform float u_time; |
||||
uniform float u_time_end; |
||||
uniform sampler2D texture; |
||||
uniform bool is_shape; |
||||
|
||||
void main() { |
||||
if(is_shape) { |
||||
vec4 color = vec4(1.0, 0.0, 0.0, 1.0); |
||||
gl_FragColor = gl_Color * color; |
||||
} else { |
||||
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy); |
||||
vec4 color = vec4(1.0, 0.0, 0.0, 1.0); |
||||
gl_FragColor = gl_Color * color * pixel; |
||||
} |
||||
} |
@ -0,0 +1,29 @@ |
||||
uniform vec2 u_resolution; |
||||
uniform vec2 u_mouse; |
||||
uniform float u_duration; |
||||
uniform float u_time; |
||||
uniform float u_time_end; |
||||
uniform sampler2D texture; |
||||
uniform bool is_shape; |
||||
uniform bool hover; |
||||
|
||||
vec4 blink() { |
||||
if(hover) { |
||||
return vec4(0.95, 0.95, 1.0, 1.0); |
||||
} else { |
||||
float tick = (u_time_end - u_time) / u_duration; |
||||
float blink = mix(0.5, 1.0, tick); |
||||
return vec4(blink, blink, blink, 1.0); |
||||
} |
||||
} |
||||
|
||||
void main() { |
||||
vec4 color = blink(); |
||||
|
||||
if(!is_shape) { |
||||
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy); |
||||
color *= pixel; |
||||
} |
||||
|
||||
gl_FragColor = gl_Color * color; |
||||
} |
@ -0,0 +1,12 @@ |
||||
uniform vec2 u_resolution; |
||||
uniform vec2 u_mouse; |
||||
uniform float u_duration; |
||||
uniform float u_time; |
||||
uniform float u_time_end; |
||||
|
||||
void main() { |
||||
float tick = (u_time_end - u_time) / u_duration; |
||||
float blink = smoothstep(1.0, 0.5, tick); |
||||
vec4 color = vec4(blink, blink, blink, 1.0); |
||||
gl_FragColor = gl_Color * color; |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,68 @@ |
||||
#include "backend.hpp" |
||||
#include <guecs/sfml/shaders.hpp> |
||||
#include <guecs/sfml/sound.hpp> |
||||
#include <guecs/sfml/textures.hpp> |
||||
#include <guecs/sfml/config.hpp> |
||||
|
||||
namespace sfml { |
||||
guecs::SpriteTexture Backend::texture_get(const string& name) { |
||||
auto sp = textures::get(name); |
||||
return {sp.sprite, sp.texture, sp.frame_size}; |
||||
} |
||||
|
||||
Backend::Backend() { |
||||
sound::init(); |
||||
shaders::init(); |
||||
textures::init(); |
||||
} |
||||
|
||||
void Backend::sound_play(const string& name) { |
||||
sound::play(name); |
||||
} |
||||
|
||||
void Backend::sound_stop(const string& name) { |
||||
sound::stop(name); |
||||
} |
||||
|
||||
std::shared_ptr<sf::Shader> Backend::shader_get(const std::string& name) { |
||||
return shaders::get(name); |
||||
} |
||||
|
||||
bool Backend::shader_updated() { |
||||
if(shaders::updated($shaders_version)) { |
||||
$shaders_version = shaders::version(); |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
guecs::Theme Backend::theme() { |
||||
guecs::Theme theme; |
||||
// {
|
||||
// .BLACK={1, 4, 2},
|
||||
// .DARK_DARK={9, 29, 16},
|
||||
// .DARK_MID={14, 50, 26},
|
||||
// .DARK_LIGHT={0, 109, 44},
|
||||
// .MID={63, 171, 92},
|
||||
// .LIGHT_DARK={161, 217, 155},
|
||||
// .LIGHT_MID={199, 233, 192},
|
||||
// .LIGHT_LIGHT={229, 245, 224},
|
||||
// .WHITE={255, 255, 255},
|
||||
// .TRANSPARENT = sf::Color::Transparent
|
||||
// };
|
||||
|
||||
theme.PADDING = 3; |
||||
theme.BORDER_PX = 1; |
||||
theme.TEXT_SIZE = 40; |
||||
theme.LABEL_SIZE = 40; |
||||
theme.FILL_COLOR = theme.DARK_DARK; |
||||
theme.TEXT_COLOR = theme.LIGHT_LIGHT; |
||||
theme.BG_COLOR = theme.MID; |
||||
theme.BORDER_COLOR = theme.LIGHT_DARK; |
||||
theme.BG_COLOR_DARK = theme.BLACK; |
||||
theme.FONT_FILE_NAME = Config::path_to("assets/text.otf").string(); |
||||
|
||||
return theme; |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
#include "guecs/ui.hpp" |
||||
|
||||
namespace sfml { |
||||
using std::string; |
||||
|
||||
class Backend : public guecs::Backend { |
||||
int $shaders_version = 0; |
||||
|
||||
public: |
||||
|
||||
Backend(); |
||||
guecs::SpriteTexture texture_get(const string& name); |
||||
void sound_play(const string& name); |
||||
void sound_stop(const string& name); |
||||
std::shared_ptr<sf::Shader> shader_get(const std::string& name); |
||||
bool shader_updated(); |
||||
guecs::Theme theme(); |
||||
}; |
||||
} |
@ -0,0 +1,47 @@ |
||||
#include "dbc.hpp" |
||||
#include <iostream> |
||||
|
||||
void dbc::log(const string &message, const std::source_location location) { |
||||
std::cout << '[' << location.file_name() << ':' |
||||
<< location.line() << "|" |
||||
<< location.function_name() << "] " |
||||
<< message << std::endl; |
||||
} |
||||
|
||||
void dbc::sentinel(const string &message, const std::source_location location) { |
||||
string err = fmt::format("[SENTINEL!] {}", message); |
||||
dbc::log(err, location); |
||||
throw dbc::SentinelError{err}; |
||||
} |
||||
|
||||
void dbc::pre(const string &message, bool test, const std::source_location location) { |
||||
if(!test) { |
||||
string err = fmt::format("[PRE!] {}", message); |
||||
dbc::log(err, location); |
||||
throw dbc::PreCondError{err}; |
||||
} |
||||
} |
||||
|
||||
void dbc::pre(const string &message, std::function<bool()> tester, const std::source_location location) { |
||||
dbc::pre(message, tester(), location); |
||||
} |
||||
|
||||
void dbc::post(const string &message, bool test, const std::source_location location) { |
||||
if(!test) { |
||||
string err = fmt::format("[POST!] {}", message); |
||||
dbc::log(err, location); |
||||
throw dbc::PostCondError{err}; |
||||
} |
||||
} |
||||
|
||||
void dbc::post(const string &message, std::function<bool()> tester, const std::source_location location) { |
||||
dbc::post(message, tester(), location); |
||||
} |
||||
|
||||
void dbc::check(bool test, const string &message, const std::source_location location) { |
||||
if(!test) { |
||||
string err = fmt::format("[CHECK!] {}\n", message); |
||||
dbc::log(err, location); |
||||
throw dbc::CheckError{err}; |
||||
} |
||||
} |
@ -0,0 +1,51 @@ |
||||
#pragma once |
||||
|
||||
#include <string> |
||||
#include <fmt/core.h> |
||||
#include <functional> |
||||
#include <source_location> |
||||
|
||||
|
||||
namespace dbc { |
||||
using std::string; |
||||
|
||||
class Error { |
||||
public: |
||||
const string message; |
||||
Error(string m) : message{m} {} |
||||
Error(const char *m) : message{m} {} |
||||
}; |
||||
|
||||
class CheckError : public Error {}; |
||||
class SentinelError : public Error {}; |
||||
class PreCondError : public Error {}; |
||||
class PostCondError : public Error {}; |
||||
|
||||
void log(const string &message, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
[[noreturn]] void sentinel(const string &message, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
void pre(const string &message, bool test, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
void pre(const string &message, std::function<bool()> tester, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
void post(const string &message, bool test, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
void post(const string &message, std::function<bool()> tester, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
|
||||
void check(bool test, const string &message, |
||||
const std::source_location location = |
||||
std::source_location::current()); |
||||
} |
@ -0,0 +1,87 @@ |
||||
#include "guecs/sfml/backend.hpp" |
||||
#include "guecs/sfml/components.hpp" |
||||
#include "guecs/ui.hpp" |
||||
#include <fmt/xchar.h> |
||||
#include <deque> |
||||
#include <iostream> |
||||
|
||||
constexpr const int WINDOW_WIDTH=1280; |
||||
constexpr const int WINDOW_HEIGHT=720; |
||||
constexpr const int FRAME_LIMIT=60; |
||||
constexpr const bool VSYNC=true; |
||||
|
||||
using std::string, std::wstring; |
||||
|
||||
struct SlidesUI { |
||||
guecs::UI $gui; |
||||
|
||||
SlidesUI() { |
||||
$gui.position(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); |
||||
$gui.layout( |
||||
"[t_left|t_center|t_right]" |
||||
"[m_left|*%(300,200)title|_|_|m_right]" |
||||
"[_|_|_|_|_]" |
||||
"[_|*%(300,300)content|_|_|_]" |
||||
"[_|_|_|_|_]" |
||||
"[_|_|_|_|_]" |
||||
"[b_left|b_center|b_right]" |
||||
); |
||||
} |
||||
|
||||
void init() { |
||||
guecs::Background bg{$gui.$parser, }; |
||||
bg.set_color(guecs::THEME.BG_COLOR_DARK); |
||||
$gui.set<guecs::Background>($gui.MAIN, bg); |
||||
|
||||
auto title = $gui.entity("title"); |
||||
$gui.set<guecs::Text>(title, { |
||||
L"Title Thing\n", 124}); |
||||
|
||||
auto content = $gui.entity("content"); |
||||
$gui.set<guecs::Text>(content, { |
||||
L"* Sample 2\n" |
||||
L"* Sample 3\n", |
||||
56, guecs::THEME.TEXT_COLOR, 20}); |
||||
|
||||
$gui.init(); |
||||
} |
||||
|
||||
void render(sf::RenderWindow& window) { |
||||
$gui.render(window); |
||||
// $gui.debug_layout(window);
|
||||
} |
||||
|
||||
void mouse(float x, float y, guecs::Modifiers mods) { |
||||
$gui.mouse(x, y, mods); |
||||
} |
||||
}; |
||||
|
||||
int main() { |
||||
sfml::Backend backend; |
||||
guecs::init(&backend); |
||||
|
||||
sf::RenderWindow window(sf::VideoMode({WINDOW_WIDTH, WINDOW_HEIGHT}), "Besos Loves Slides"); |
||||
window.setFramerateLimit(FRAME_LIMIT); |
||||
window.setVerticalSyncEnabled(VSYNC); |
||||
|
||||
SlidesUI slides; |
||||
slides.init(); |
||||
|
||||
while(window.isOpen()) { |
||||
while (const auto event = window.pollEvent()) { |
||||
if(event->is<sf::Event::Closed>()) { |
||||
window.close(); |
||||
} |
||||
|
||||
if(const auto* mouse = event->getIf<sf::Event::MouseButtonPressed>()) { |
||||
if(mouse->button == sf::Mouse::Button::Left) { |
||||
sf::Vector2f pos = window.mapPixelToCoords(mouse->position); |
||||
slides.mouse(pos.x, pos.y, {}); |
||||
} |
||||
} |
||||
} |
||||
|
||||
slides.render(window); |
||||
window.display(); |
||||
} |
||||
} |
@ -0,0 +1,102 @@ |
||||
# clang might need _LIBCPP_ENABLE_CXX26_REMOVED_CODECVT |
||||
|
||||
project('lel-sfml-starter', 'cpp', |
||||
version: '0.1.0', |
||||
default_options: [ |
||||
'cpp_std=c++20', |
||||
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1', |
||||
]) |
||||
|
||||
# use this for common options only for our executables |
||||
cpp_args=[] |
||||
link_args=[] |
||||
# these are passed as override_defaults |
||||
exe_defaults = [ 'warning_level=2' ] |
||||
|
||||
cc = meson.get_compiler('cpp') |
||||
dependencies = [] |
||||
|
||||
if build_machine.system() == 'windows' |
||||
add_global_link_arguments( |
||||
'-static-libgcc', |
||||
'-static-libstdc++', |
||||
'-static', |
||||
language: 'cpp', |
||||
) |
||||
|
||||
sfml_main = subproject('sfml').get_variable('sfml_main_dep') |
||||
opengl32 = cc.find_library('opengl32', required: true) |
||||
winmm = cc.find_library('winmm', required: true) |
||||
gdi32 = cc.find_library('gdi32', required: true) |
||||
|
||||
dependencies += [ |
||||
opengl32, winmm, gdi32, sfml_main |
||||
] |
||||
exe_defaults += ['werror=true'] |
||||
|
||||
elif build_machine.system() == 'darwin' |
||||
add_global_link_arguments( |
||||
language: 'cpp', |
||||
) |
||||
|
||||
opengl = dependency('OpenGL') |
||||
corefoundation = dependency('CoreFoundation') |
||||
carbon = dependency('Carbon') |
||||
cocoa = dependency('Cocoa') |
||||
iokit = dependency('IOKit') |
||||
corevideo = dependency('CoreVideo') |
||||
|
||||
link_args += ['-ObjC'] |
||||
exe_defaults += ['werror=false'] |
||||
dependencies += [ |
||||
opengl, corefoundation, carbon, cocoa, iokit, corevideo |
||||
] |
||||
endif |
||||
|
||||
catch2 = subproject('catch2').get_variable('catch2_with_main_dep') |
||||
fmt = subproject('fmt').get_variable('fmt_dep') |
||||
json = subproject('nlohmann_json').get_variable('nlohmann_json_dep') |
||||
freetype2 = subproject('freetype2').get_variable('freetype_dep') |
||||
|
||||
flac = subproject('flac').get_variable('flac_dep') |
||||
ogg = subproject('ogg').get_variable('libogg_dep') |
||||
vorbis = subproject('vorbis').get_variable('vorbis_dep') |
||||
vorbisfile = subproject('vorbis').get_variable('vorbisfile_dep') |
||||
vorbisenc = subproject('vorbis').get_variable('vorbisenc_dep') |
||||
sfml_audio = subproject('sfml').get_variable('sfml_audio_dep') |
||||
sfml_graphics = subproject('sfml').get_variable('sfml_graphics_dep') |
||||
sfml_network = subproject('sfml').get_variable('sfml_network_dep') |
||||
sfml_system = subproject('sfml').get_variable('sfml_system_dep') |
||||
sfml_window = subproject('sfml').get_variable('sfml_window_dep') |
||||
lel_guecs = subproject('lel-guecs').get_variable('lel_guecs_dep') |
||||
lel_guecs_sfml = subproject('lel-guecs').get_variable('lel_guecs_sfml_dep') |
||||
|
||||
dependencies += [ |
||||
fmt, json, freetype2, |
||||
flac, ogg, vorbis, vorbisfile, vorbisenc, |
||||
sfml_audio, sfml_graphics, |
||||
sfml_network, sfml_system, |
||||
sfml_window, lel_guecs, lel_guecs_sfml |
||||
] |
||||
|
||||
sources = [ |
||||
'dbc.cpp', |
||||
'backend.cpp', |
||||
'main.cpp', |
||||
] |
||||
|
||||
tests = [ |
||||
'tests/sample.cpp' |
||||
] |
||||
|
||||
executable('besos', sources, |
||||
cpp_args: cpp_args, |
||||
link_args: link_args, |
||||
override_options: exe_defaults, |
||||
dependencies: dependencies) |
||||
|
||||
executable('runtests', sources + tests, |
||||
cpp_args: cpp_args, |
||||
link_args: link_args, |
||||
override_options: exe_defaults, |
||||
dependencies: dependencies + [catch2]) |
@ -0,0 +1,18 @@ |
||||
{ |
||||
"title": "1: A Good First Program", |
||||
"summary": "If you skipped Exercise 0, then you are not doing this book right." |
||||
} |
||||
=== |
||||
1: A Good First Program |
||||
--- |
||||
What You Should See |
||||
--- |
||||
Study Drills |
||||
--- |
||||
Common Student Questions |
||||
--- |
||||
The Blue Plus |
||||
--- |
||||
The End |
||||
|
||||
# See You Soon! |
@ -0,0 +1,13 @@ |
||||
rm -recurse -force coverage/* |
||||
cp *.cpp,*.hpp,*.rl builddir |
||||
|
||||
. .venv/Scripts/activate |
||||
|
||||
rm -recurse -force coverage |
||||
cp scripts\gcovr_patched_coverage.py .venv\Lib\site-packages\gcovr\coverage.py |
||||
|
||||
gcovr -o coverage/ --html --html-details --html-theme github.dark-blue --gcov-ignore-errors all --gcov-ignore-parse-errors negative_hits.warn_once_per_file -e builddir/subprojects -e builddir -e subprojects -j 10 . |
||||
|
||||
rm *.gcov.json.gz |
||||
|
||||
start .\coverage\coverage_details.html |
@ -0,0 +1,7 @@ |
||||
mv .\subprojects\packagecache . |
||||
rm -recurse -force .\subprojects\,.\builddir\ |
||||
mkdir subprojects |
||||
mv .\packagecache .\subprojects\ |
||||
mkdir builddir |
||||
cp wraps\*.wrap subprojects\ |
||||
meson setup --default-library=static --prefer-static -Db_coverage=true builddir |
@ -0,0 +1,11 @@ |
||||
#!/usr/bin/env bash |
||||
set -e |
||||
|
||||
mv -f ./subprojects/packagecache . |
||||
rm -rf subprojects builddir |
||||
mkdir subprojects |
||||
mv packagecache ./subprojects/ |
||||
mkdir builddir |
||||
cp wraps/*.wrap subprojects/ |
||||
# on OSX you can't do this with static |
||||
meson setup -Db_coverage=true builddir |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@ |
||||
mv .\subprojects\packagecache . |
||||
rm -recurse -force .\subprojects\,.\builddir\ |
||||
mkdir subprojects |
||||
mv .\packagecache .\subprojects\ |
||||
mkdir builddir |
||||
cp wraps\*.wrap subprojects\ |
||||
meson setup --default-library=static --prefer-static builddir |
@ -0,0 +1,10 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
mv -f ./subprojects/packagecache . |
||||
rm -rf subprojects builddir |
||||
mkdir subprojects |
||||
mv -f packagecache ./subprojects/ && true |
||||
mkdir builddir |
||||
cp wraps/*.wrap subprojects/ |
||||
# on OSX you can't do this with static |
||||
meson setup --default-library=static --prefer-static builddir |
Binary file not shown.
@ -0,0 +1,7 @@ |
||||
#include <catch2/catch_test_macros.hpp> |
||||
#include <fmt/core.h> |
||||
#include <string> |
||||
|
||||
TEST_CASE("basic sample test", "[test-sample]") { |
||||
REQUIRE(1 + 2 == 3); |
||||
} |
@ -0,0 +1,10 @@ |
||||
[wrap-file] |
||||
directory = cairo-1.18.4 |
||||
source_url = https://www.cairographics.org/releases/cairo-1.18.4.tar.xz |
||||
source_filename = cairo-1.18.4.tar.xz |
||||
source_hash = 445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cairo_1.18.4-1/cairo-1.18.4.tar.xz |
||||
wrapdb_version = 1.18.4-1 |
||||
|
||||
[provide] |
||||
dependency_names = cairo, cairo-gobject |
@ -0,0 +1,11 @@ |
||||
[wrap-file] |
||||
directory = Catch2-3.7.1 |
||||
source_url = https://github.com/catchorg/Catch2/archive/v3.7.1.tar.gz |
||||
source_filename = Catch2-3.7.1.tar.gz |
||||
source_hash = c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/catch2_3.7.1-1/Catch2-3.7.1.tar.gz |
||||
wrapdb_version = 3.7.1-1 |
||||
|
||||
[provide] |
||||
catch2 = catch2_dep |
||||
catch2-with-main = catch2_with_main_dep |
@ -0,0 +1,13 @@ |
||||
[wrap-file] |
||||
directory = flac-1.4.3 |
||||
source_url = https://github.com/xiph/flac/releases/download/1.4.3/flac-1.4.3.tar.xz |
||||
source_filename = flac-1.4.3.tar.xz |
||||
source_hash = 6c58e69cd22348f441b861092b825e591d0b822e106de6eb0ee4d05d27205b70 |
||||
patch_filename = flac_1.4.3-2_patch.zip |
||||
patch_url = https://wrapdb.mesonbuild.com/v2/flac_1.4.3-2/get_patch |
||||
patch_hash = 3eace1bd0769d3e0d4ff099960160766a5185d391c8f583293b087a1f96c2a9c |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/flac_1.4.3-2/flac-1.4.3.tar.xz |
||||
wrapdb_version = 1.4.3-2 |
||||
|
||||
[provide] |
||||
flac = flac_dep |
@ -0,0 +1,13 @@ |
||||
[wrap-file] |
||||
directory = fmt-11.0.2 |
||||
source_url = https://github.com/fmtlib/fmt/archive/11.0.2.tar.gz |
||||
source_filename = fmt-11.0.2.tar.gz |
||||
source_hash = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f |
||||
patch_filename = fmt_11.0.2-1_patch.zip |
||||
patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.2-1/get_patch |
||||
patch_hash = 90c9e3b8e8f29713d40ca949f6f93ad115d78d7fb921064112bc6179e6427c5e |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.2-1/fmt-11.0.2.tar.gz |
||||
wrapdb_version = 11.0.2-1 |
||||
|
||||
[provide] |
||||
fmt = fmt_dep |
@ -0,0 +1,11 @@ |
||||
[wrap-file] |
||||
directory = freetype-2.13.3 |
||||
source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.xz |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/freetype2_2.13.3-1/freetype-2.13.3.tar.xz |
||||
source_filename = freetype-2.13.3.tar.xz |
||||
source_hash = 0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 |
||||
wrapdb_version = 2.13.3-1 |
||||
|
||||
[provide] |
||||
freetype2 = freetype_dep |
||||
freetype = freetype_dep |
@ -0,0 +1,9 @@ |
||||
[wrap-git] |
||||
directory=lel-guecs-0.6.0 |
||||
url=https://git.learnjsthehardway.com/learn-code-the-hard-way/lel-guecs.git |
||||
revision=HEAD |
||||
depth=1 |
||||
method=meson |
||||
|
||||
[provide] |
||||
lel_guecs = lel_guecs_dep |
@ -0,0 +1,13 @@ |
||||
[wrap-file] |
||||
directory = libpng-1.6.44 |
||||
source_url = https://github.com/glennrp/libpng/archive/v1.6.44.tar.gz |
||||
source_filename = libpng-1.6.44.tar.gz |
||||
source_hash = 0ef5b633d0c65f780c4fced27ff832998e71478c13b45dfb6e94f23a82f64f7c |
||||
patch_filename = libpng_1.6.44-1_patch.zip |
||||
patch_url = https://wrapdb.mesonbuild.com/v2/libpng_1.6.44-1/get_patch |
||||
patch_hash = 394b07614c45fbd1beac8b660386216a490fe12f841a1a445799b676c9c892fb |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/libpng_1.6.44-1/libpng-1.6.44.tar.gz |
||||
wrapdb_version = 1.6.44-1 |
||||
|
||||
[provide] |
||||
libpng = libpng_dep |
@ -0,0 +1,11 @@ |
||||
[wrap-file] |
||||
directory = nlohmann_json-3.11.3 |
||||
lead_directory_missing = true |
||||
source_url = https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip |
||||
source_filename = nlohmann_json-3.11.3.zip |
||||
source_hash = a22461d13119ac5c78f205d3df1db13403e58ce1bb1794edc9313677313f4a9d |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/nlohmann_json_3.11.3-1/nlohmann_json-3.11.3.zip |
||||
wrapdb_version = 3.11.3-1 |
||||
|
||||
[provide] |
||||
nlohmann_json = nlohmann_json_dep |
@ -0,0 +1,13 @@ |
||||
[wrap-file] |
||||
directory = libogg-1.3.5 |
||||
source_url = https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.xz |
||||
source_filename = libogg-1.3.5.tar.xz |
||||
source_hash = c4d91be36fc8e54deae7575241e03f4211eb102afb3fc0775fbbc1b740016705 |
||||
patch_filename = ogg_1.3.5-6_patch.zip |
||||
patch_url = https://wrapdb.mesonbuild.com/v2/ogg_1.3.5-6/get_patch |
||||
patch_hash = 8be6dcd5f93bbf9c0b9c8ec1fa29810226a60f846383074ca05b313a248e78b2 |
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/ogg_1.3.5-6/libogg-1.3.5.tar.xz |
||||
wrapdb_version = 1.3.5-6 |
||||
|
||||
[provide] |
||||
ogg = libogg_dep |
@ -0,0 +1,9 @@ |
||||
[wrap-git] |
||||
directory=poppler-25.08.0 |
||||
url=https://gitlab.freedesktop.org/poppler/poppler.git |
||||
revision=poppler-25.08.0 |
||||
depth=1 |
||||
method=cmake |
||||
|
||||
[provide] |
||||
poppler = poppler_dep |
@ -0,0 +1,14 @@ |
||||
[wrap-git] |
||||
directory=SFML-3.0.0 |
||||
url=https://github.com/SFML/SFML.git |
||||
revision=3.0.0 |
||||
depth=1 |
||||
method=cmake |
||||
|
||||
[provide] |
||||
sfml_audio = sfml_audio_dep |
||||
sfml_graphics = sfml_graphics_dep |
||||
sfml_main = sfml_main_dep |
||||
sfml_network = sfml_network_dep |
||||
sfml_system = sfml_system_dep |
||||
sfml_window = sfml_window_dep |
@ -0,0 +1,7 @@ |
||||
[wrap-git] |
||||
url=https://github.com/wolfpld/tracy.git |
||||
revision=v0.11.1 |
||||
depth=1 |
||||
|
||||
[provide] |
||||
tracy = tracy_dep |
@ -0,0 +1,14 @@ |
||||
[wrap-file] |
||||
directory = libvorbis-1.3.7 |
||||
source_url = https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz |
||||
source_filename = libvorbis-1.3.7.tar.xz |
||||
source_hash = b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b |
||||
patch_filename = vorbis_1.3.7-4_patch.zip |
||||
patch_url = https://wrapdb.mesonbuild.com/v2/vorbis_1.3.7-4/get_patch |
||||
patch_hash = 979e22b24b16c927040700dfd8319cd6ba29bf52a14dbc66b1cb4ea60504f14a |
||||
wrapdb_version = 1.3.7-4 |
||||
|
||||
[provide] |
||||
vorbis = vorbis_dep |
||||
vorbisfile = vorbisfile_dep |
||||
vorbisenc = vorbisenc_dep |
Loading…
Reference in new issue