41 lines
930 B
C
41 lines
930 B
C
/**
|
|
* Game Client Main Entry Point
|
|
* Uses the split modules: suic_game_client, suic_terrain, suic_lighting, suic_net, suic_ui
|
|
*/
|
|
|
|
#include "suic_game_client.h"
|
|
#include "suic_ui.h"
|
|
#include "raylib.h"
|
|
|
|
int main(void) {
|
|
const int screenW = 1280, screenH = 720;
|
|
InitWindow(screenW, screenH, "Voxel Shooter - Client");
|
|
SetTargetFPS(120);
|
|
|
|
/* Get username */
|
|
char username[SUIC_NET_USERNAME_MAX] = {0};
|
|
suic_ui_username_prompt(username, SUIC_NET_USERNAME_MAX);
|
|
|
|
/* Initialize game subsystems */
|
|
suic_game_init(username, "127.0.0.1", 27015);
|
|
|
|
/* Main loop */
|
|
while (!WindowShouldClose()) {
|
|
float dt = GetFrameTime();
|
|
|
|
suic_game_handle_input(dt);
|
|
suic_game_update(dt);
|
|
|
|
BeginDrawing();
|
|
ClearBackground((Color){135, 206, 235, 255});
|
|
|
|
suic_game_render();
|
|
|
|
EndDrawing();
|
|
}
|
|
|
|
suic_game_shutdown();
|
|
CloseWindow();
|
|
|
|
return 0;
|
|
}
|