-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprograma_basico.cpp
More file actions
34 lines (23 loc) · 1.22 KB
/
programa_basico.cpp
File metadata and controls
34 lines (23 loc) · 1.22 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
#include "raylib.h"
const int screen_width = 1200; // Largura da tela
const int screen_height = 900; // Altura da tela
const int frame_rate = 60; // FPS
int main(void){
SetTargetFPS(frame_rate); // Determina o FPS
InitWindow(screen_width, screen_height, "Name"); // Inicializa a tela, tudo que envolver gráficos deve ser feito após essa função.
//------------------------------------------
// CARREGUE SEUS GRÁFICOS AQUI (LoadTexture)
//------------------------------------------
while(!WindowShouldClose()){ // Executa enquanto a janela não for fechada
//-----------------------------
// ATUALIZE SUAS VARIÁVEIS AQUI
//-----------------------------
BeginDrawing(); // Comando que indica o início de geração de um quadro.
ClearBackground(RAYWHITE); // Cria um "buffer", serve para não deixar resquícios do frame anterior na tela. SEMPRE que for desenhar algo na tela utilize esta função logo após o BeginDrawing
//-----------------------------
// DESENHE SEU JOGO AQUI
//-----------------------------
EndDrawing(); // Indica o fim de geração do frame.
}
return 0;
}