first commit test
This commit is contained in:
19
src/main.c
19
src/main.c
@@ -17,13 +17,17 @@ int main ()
|
||||
SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_HIGHDPI);
|
||||
|
||||
// Create the window and OpenGL context
|
||||
InitWindow(800, 600, "Hello Raylib");
|
||||
InitWindow(800, 600, "Hello Emi");
|
||||
|
||||
// Utility function from resource_dir.h to find the resources folder and set it as the current working directory so we can load from it
|
||||
SearchAndSetResourceDir("resources");
|
||||
|
||||
// Load a texture from the resources directory
|
||||
Texture wabbit = LoadTexture("wabbit_alpha.png");
|
||||
Image image = LoadImage("emi.png");
|
||||
Texture2D emi = LoadTextureFromImage(image);
|
||||
UnloadImage(image);
|
||||
|
||||
|
||||
|
||||
// game loop
|
||||
while (!WindowShouldClose()) // run the loop until the user presses ESCAPE or presses the Close button on the window
|
||||
@@ -34,11 +38,12 @@ int main ()
|
||||
// Setup the back buffer for drawing (clear color and depth buffers)
|
||||
ClearBackground(BLACK);
|
||||
|
||||
// draw some text using the default font
|
||||
DrawText("Hello Raylib", 200,200,20,WHITE);
|
||||
|
||||
// draw our texture to the screen
|
||||
DrawTexture(wabbit, 400, 200, WHITE);
|
||||
DrawTexture(emi, 800/2 - emi.width/2, 600/2 - emi.height/2, WHITE);
|
||||
|
||||
// draw some text using the default font
|
||||
DrawText("Emi la plus belle", 200,50,20,PINK);
|
||||
|
||||
|
||||
// end the frame and get ready for the next one (display frame, poll input, etc...)
|
||||
EndDrawing();
|
||||
@@ -46,7 +51,7 @@ int main ()
|
||||
|
||||
// cleanup
|
||||
// unload our texture so it can be cleaned up
|
||||
UnloadTexture(wabbit);
|
||||
UnloadTexture(emi);
|
||||
|
||||
// destroy the window and cleanup the OpenGL context
|
||||
CloseWindow();
|
||||
|
||||
Reference in New Issue
Block a user