-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLife23.cpp
More file actions
40 lines (34 loc) · 911 Bytes
/
Life23.cpp
File metadata and controls
40 lines (34 loc) · 911 Bytes
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
// Life23.cpp
#include "Grid.h"
#include "rlImGui.h"
#include <imgui.h>
#include <raylib.h>
#include <rlgl.h>
#include <string>
#include "Simulation.h"
#include "GuiManager.h"
int main( int argc, char* argv[] ) {
SetConfigFlags( FLAG_WINDOW_RESIZABLE );
InitWindow( 1600, 900, "Life23" );
// SetTargetFPS( 60 );
Simulation sim( 160, 90 );
GuiManager gui( sim );
rlImGuiSetup( true );
ImGui::GetIO( ).IniFilename = NULL;
ImGui::GetIO( ).LogFilename = NULL;
while ( !WindowShouldClose( ) ) {
auto& io = ImGui::GetIO( );
sim.Update( io.WantCaptureKeyboard, io.WantCaptureMouse );
BeginDrawing( );
rlImGuiBegin( );
sim.Draw( io.WantCaptureMouse );
gui.Draw( );
rlImGuiEnd( );
DrawCircle( GetMouseX( ), GetMouseY( ), 4, { 255, 255, 255, 255 } );
DrawCircle( GetMouseX( ), GetMouseY( ), 3, { 255, 0, 255, 255 } );
EndDrawing( );
}
rlImGuiShutdown( );
CloseWindow( );
return 0;
}