adapt 2D view on window resolution changes
parent
cf173f3d50
commit
80fbb030bd
|
@ -27,7 +27,7 @@ static bool request_shutdown;
|
||||||
|
|
||||||
void platform_init() {
|
void platform_init() {
|
||||||
InitWindow(screenWidth, screenHeight, "eco2d");
|
InitWindow(screenWidth, screenHeight, "eco2d");
|
||||||
SetWindowState(FLAG_WINDOW_UNDECORATED|FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE|FLAG_MSAA_4X_HINT);
|
SetWindowState(/*FLAG_WINDOW_UNDECORATED|*/FLAG_WINDOW_MAXIMIZED|FLAG_WINDOW_RESIZABLE|FLAG_MSAA_4X_HINT);
|
||||||
|
|
||||||
screenWidth = (uint16_t)GetScreenWidth();
|
screenWidth = (uint16_t)GetScreenWidth();
|
||||||
screenHeight = (uint16_t)GetScreenHeight();
|
screenHeight = (uint16_t)GetScreenHeight();
|
||||||
|
@ -169,6 +169,9 @@ void platform_input() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_render() {
|
void platform_render() {
|
||||||
|
screenWidth = (uint16_t)GetScreenWidth();
|
||||||
|
screenHeight = (uint16_t)GetScreenHeight();
|
||||||
|
|
||||||
profile(PROF_ENTITY_LERP) {
|
profile(PROF_ENTITY_LERP) {
|
||||||
game_world_view_active_entity_map(lerp_entity_positions);
|
game_world_view_active_entity_map(lerp_entity_positions);
|
||||||
game_world_view_active_entity_map(do_entity_fadeinout);
|
game_world_view_active_entity_map(do_entity_fadeinout);
|
||||||
|
|
|
@ -119,6 +119,7 @@ void DEBUG_draw_entities_low(uint64_t key, entity_view * data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void renderer_draw_v0(void) {
|
void renderer_draw_v0(void) {
|
||||||
|
render_camera.offset = (Vector2){(float)(screenWidth >> 1), (float)(screenHeight >> 1)};
|
||||||
render_camera.zoom = zpl_lerp(render_camera.zoom, target_zoom, GetFrameTime()*2.9978f);
|
render_camera.zoom = zpl_lerp(render_camera.zoom, target_zoom, GetFrameTime()*2.9978f);
|
||||||
camera_update();
|
camera_update();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue