mirror of
https://github.com/raylib-zig/raylib-zig.git
synced 2025-12-06 06:13:08 +00:00
Fix #3 on workaround branch
This commit is contained in:
parent
ae1ab4747e
commit
f545110e62
@ -36,6 +36,7 @@ pub fn build(b: *Builder) void
|
|||||||
var modelsLoading = createExe(b, "models_loading" , "examples/models/models_loading.zig" , "Loads a model and renders it");
|
var modelsLoading = createExe(b, "models_loading" , "examples/models/models_loading.zig" , "Loads a model and renders it");
|
||||||
var mouseRay = createExe(b, "draw_2d" , "tests/draw_2d.zig" , "Testing workaround on 2D drawing functions");
|
var mouseRay = createExe(b, "draw_2d" , "tests/draw_2d.zig" , "Testing workaround on 2D drawing functions");
|
||||||
var drawSphere = createExe(b, "draw_sphere" , "tests/draw_sphere.zig" , "Testing workaround on DrawSphere");
|
var drawSphere = createExe(b, "draw_sphere" , "tests/draw_sphere.zig" , "Testing workaround on DrawSphere");
|
||||||
|
var delExitKey = createExe(b, "del_exit_key" , "tests/del_exit_key.zig" , "Testing disabling of exit key");
|
||||||
|
|
||||||
const examplesStep = b.step("examples", "Builds all the examples");
|
const examplesStep = b.step("examples", "Builds all the examples");
|
||||||
examplesStep.dependOn(&basicWindow.step);
|
examplesStep.dependOn(&basicWindow.step);
|
||||||
|
|||||||
@ -423,6 +423,7 @@ pub const TraceLogType = extern enum(c_int) {
|
|||||||
LOG_NONE = 7,
|
LOG_NONE = 7,
|
||||||
};
|
};
|
||||||
pub const KeyboardKey = extern enum(c_int) {
|
pub const KeyboardKey = extern enum(c_int) {
|
||||||
|
KEY_NULL = 0,
|
||||||
KEY_APOSTROPHE = 39,
|
KEY_APOSTROPHE = 39,
|
||||||
KEY_COMMA = 44,
|
KEY_COMMA = 44,
|
||||||
KEY_MINUS = 45,
|
KEY_MINUS = 45,
|
||||||
|
|||||||
46
tests/del_exit_key.zig
Normal file
46
tests/del_exit_key.zig
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
//
|
||||||
|
// mouse_ray
|
||||||
|
// Zig version: 0.6.0
|
||||||
|
// Author: Nikolas Wipper
|
||||||
|
// Date: 2020-02-15
|
||||||
|
//
|
||||||
|
|
||||||
|
usingnamespace @import("raylib");
|
||||||
|
|
||||||
|
pub fn main() anyerror!void
|
||||||
|
{
|
||||||
|
// Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
const screenWidth = 800;
|
||||||
|
const screenHeight = 450;
|
||||||
|
|
||||||
|
InitWindow(screenWidth, screenHeight, "raylib-zig [core] test - disable exit key");
|
||||||
|
|
||||||
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
|
|
||||||
|
//SetExitKey(@intToEnum(KeyboardKey, 0));
|
||||||
|
SetExitKey(.KEY_NULL);
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Main game loop
|
||||||
|
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||||
|
{
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(WHITE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
//----------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
|
// De-Initialization
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
CloseWindow(); // Close window and OpenGL context
|
||||||
|
//--------------------------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ pub fn main() anyerror!void
|
|||||||
const screenWidth = 800;
|
const screenWidth = 800;
|
||||||
const screenHeight = 450;
|
const screenHeight = 450;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib-zig [core] example - draw sphere");
|
InitWindow(screenWidth, screenHeight, "raylib-zig [core] test - draw sphere");
|
||||||
|
|
||||||
var camera = Camera {
|
var camera = Camera {
|
||||||
.position = Vector3 { .x = 0.0, .y = 0.0, .z = 0.0 }, // Camera position
|
.position = Vector3 { .x = 0.0, .y = 0.0, .z = 0.0 }, // Camera position
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user