From 64a4ef67c5c976641e13c4a81f2e6c1c1c063084 Mon Sep 17 00:00:00 2001 From: realtradam Date: Tue, 4 Jan 2022 15:13:45 -0500 Subject: . --- src/example.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/example.c b/src/example.c index 146ea35..c5d573c 100644 --- a/src/example.c +++ b/src/example.c @@ -1,15 +1,54 @@ #include #include #include +#include "raylib.h" +const int screenWidth = 800; +const int screenHeight = 450; static mrb_value mrb_c_method(mrb_state *mrb, mrb_value self) { //mrb_ensure_string_type(mrb, self); //printf("%s: A C Extension\n", mrb_str_to_cstr(mrb, self)); - printf("A C Extension\n"); + // Initialization + //-------------------------------------------------------------------------------------- - return self; + InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- + + Texture2D texture = LoadTexture("assets/HYPERS.png"); + struct Vector2 position = { 0, 0 }; + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + // TODO: Update your variables here + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + DrawTextureEx(texture, position, 0.0f, 4.0f, WHITE); + + DrawText("HYPERS!", 500, 50, 20, RED); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; } void -- cgit v1.2.3