forked from guzmalalo/raylib_base
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
47 lines (37 loc) · 1.54 KB
/
main.c
File metadata and controls
47 lines (37 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "raylib.h"
#define WIDTH 800
#define HEIGHT 600
int main(void) {
// Initialisation de la fenêtre avec un titre
InitWindow(WIDTH, HEIGHT, "ECE");
// Initialisation de ressources
Image logoEce = LoadImage("../ressources/ece-logo.png");
ImageResize(&logoEce, logoEce.width / 2, logoEce.height / 2);
Texture2D textureEce = LoadTextureFromImage(logoEce);
// Fréquence d'affichage
SetTargetFPS(60);
// Boucle principale
// Le jeu tourne tant qu'on n'a pas cliqué sur le bouton Fermer
// ou sur la touche échap
while (!WindowShouldClose()) {
// Mise à jour de la logique du jeu
//----------------------------------------------------------------------------------
// A faire !
//----------------------------------------------------------------------------------
// Dessin
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawTexture(textureEce, 0, 0, RAYWHITE);
DrawText("Bonjour les ING 1!", 200, 400, 40, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// Libération de ressources
//--------------------------------------------------------------------------------------
UnloadImage(logoEce);
UnloadTexture(textureEce);
CloseWindow();
//--------------------------------------------------------------------------------------
return 0;
}