Compare commits

...

2 Commits

Author SHA1 Message Date
1252ed7879 Fix a few new D compilation errors 2022-04-12 09:20:03 -04:00
c9650aada7 Update rscons 2022-04-12 09:19:18 -04:00
6 changed files with 46 additions and 22 deletions

View File

@ -6,17 +6,15 @@ configure do
check_program "convert" check_program "convert"
end end
build do main_env = env do |env|
main_env = Rscons::Environment.new do |env| env["sources"] = glob("src/**/*.{c,d}", "libs/Derelict*/**/*.d")
env["sources"] = glob("src/**/*.{c,d}", "libs/Derelict*/**/*.d") env["CCFLAGS"] += %w[-Wall]
env["CCFLAGS"] += %w[-Wall] env["D_IMPORT_PATH"] += glob("src", "libs/Derelict*/source")
env["D_IMPORT_PATH"] += glob("src/**", "libs/Derelict*/source") env["DFLAGS"] += %w[-Wall]
env["DFLAGS"] += %w[-Wall] env["LIBS"] += %w[X11 GLX]
env["LIBS"] += %w[X11 GLX] env.Program("jes", "${sources}")
env.Program("jes", "${sources}") end
end main_env.clone do |env|
main_env.clone do |env| env["DFLAGS"] += %w[-g -funittest]
env["DFLAGS"] += %w[-g -funittest] env.Program("jestest", "${sources}")
env.Program("jestest", "${sources}")
end
end end

31
rscons

File diff suppressed because one or more lines are too long

View File

@ -155,9 +155,9 @@ class Program(uniforms...)
{ {
static if ((i % 2) == 0) static if ((i % 2) == 0)
{ {
mixin("void set_" ~ v ~ "(" ~ uniform_param_decl_list(uniforms[i + 1]) ~ ")" mixin("void set_" ~ v ~ "(" ~ uniform_param_decl_list(uniforms[i + 1]) ~ ")" ~
"{" "{" ~
" glUniform" ~ uniforms[i + 1] ~ "(m_uniform_" ~ v ~ ", " ~ uniform_param_list(uniforms[i + 1]) ~ ");" " glUniform" ~ uniforms[i + 1] ~ "(m_uniform_" ~ v ~ ", " ~ uniform_param_list(uniforms[i + 1]) ~ ");" ~
"}"); "}");
} }
} }

View File

@ -8,7 +8,7 @@ class Gui
{ {
this() this()
{ {
if (!jtk.init()) if (!jtk.initialize())
{ {
throw new Exception("JTK initialization failed."); throw new Exception("JTK initialization failed.");
} }

View File

@ -9,7 +9,7 @@ import derelict.opengl;
private extern(C) bool jtk_init(); private extern(C) bool jtk_init();
private extern(C) void jtk_quit(); private extern(C) void jtk_quit();
bool init() bool initialize()
{ {
DerelictGL3.load(); DerelictGL3.load();

View File

@ -2,6 +2,7 @@ module jtk.window;
import std.string; import std.string;
import core.sync.mutex; import core.sync.mutex;
import core.exception;
import derelict.opengl; import derelict.opengl;
@ -71,7 +72,7 @@ class Window
{ {
return windows_by_id[window_id]; return windows_by_id[window_id];
} }
catch (core.exception.RangeError re) catch (RangeError re)
{ {
throw new Exception("Could not find requested JTK window ID"); throw new Exception("Could not find requested JTK window ID");
} }