diff options
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index 34e3844..baca0e0 100644 --- a/src/main.zig +++ b/src/main.zig @@ -16,14 +16,24 @@ // You should have received a copy of the GNU General Public License // along with Black Shades. If not, see <https://www.gnu.org/licenses/>. -const legacy = @cImport({ @cInclude("Game.h"); }); -const al = @import("zeal"); +const Loca = @import("loca").Loca; +const allocator = @import("std").heap.c_allocator; +const legacy = @cImport(@cInclude("Game.h")); +const configuration = @import("config.zig"); +const zeal = @import("zeal"); pub fn main() !void { - try al.init(null); - defer al.deinit() catch unreachable; + const loca = try Loca.init(allocator, .{}); + defer loca.deinit(); + const config = try configuration.parse(allocator, loca.user_config); - const game = legacy.makeGame(); + const device = try zeal.Device.init(null); + defer device.deinit() catch unreachable; + const context = try zeal.Context.init(device, &.{ }); + defer context.deinit() catch unreachable; + try zeal.useContext(context); + + const game = legacy.makeGame(@bitCast(legacy.Config, config)); legacy.initGl(game); legacy.initGame(game); defer legacy.closeGame(game); |