04-25-2018, 12:00 PM
In the listed graphic setup code for the early projects, the init_ogl function is a basic system which works fine for windowed EGL display, but it should also be possible to set full screen mode by sending either 1920x1080 or the returns value from
However due to a missing set up in the init_ogl function, on page 47, the early projects can't go full screen, but you can correct this by adding two lines as noted here
The downloaded files should all have this fix but I will check to make sure.
Code:
uint width, height;
graphics_get_display_size(0, &width, &height);
init_ogl(p_state, width, height);
However due to a missing set up in the init_ogl function, on page 47, the early projects can't go full screen, but you can correct this by adding two lines as noted here
PHP Code:
state->width = width;
state->height = height;
dest_rect.x = 0;
dest_rect.y = 0;
dest_rect.width = state->width; // it needs to know our window size
dest_rect.height = state->height;
src_rect.x = 0;
src_rect.y = 0;
//ADD these two lines if you are using a full screen mode
src_rect.width = width << 16;
src_rect.height = height << 16;
The downloaded files should all have this fix but I will check to make sure.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's