graphics_get_display_size is returning 1920x1080 ... no matter what resolution I am actually in. This is noticeable in the hello_triangle demo ... By which the cube is only partially visible.
Is this the intended behaviour of graphics_get_display_size or is it supposed to return 1280x720 in this situation
The code I'm using to test this:
Code: Select all
#include "bcm_host.h"
#include "GLES/gl.h"
#include "EGL/egl.h"
#include <stdio.h>
#include <assert.h>
EGLDisplay display;
EGLConfig config;
EGLContext context;
uint32_t screen_width;
uint32_t screen_height;
int main(){
EGLBoolean result;
EGLint num_config;
bcm_host_init();
static const EGLint attribute_list[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(display!=EGL_NO_DISPLAY);
result = eglInitialize(display, NULL, NULL);
assert(result!=EGL_FALSE);
result = eglChooseConfig(display, attribute_list, &config, 1, &num_config);
assert(result!=EGL_FALSE);
context = eglCreateContext(display, config, EGL_NO_CONTEXT, NULL);
assert(context!=EGL_NO_CONTEXT);
graphics_get_display_size(0 /* LCD */, &screen_width, &screen_height);
printf("%ux%u\n",screen_width,screen_height);
}
Code: Select all
pi@raspberrypi:~$ /opt/vc/bin/tvservice -m CEA
Group CEA has 9 modes:
mode 1: 640x480 @ 60Hz, progressive
mode 2: 720x480 @ 60Hz, progressive
mode 3: 720x480 @ 60Hz, progressive
(native) mode 4: 1280x720 @ 60Hz, progressive
mode 5: 1920x1080 @ 60Hz, interlaced
(native) mode 17: 720x576 @ 50Hz, progressive
mode 18: 720x576 @ 50Hz, progressive
mode 19: 1280x720 @ 50Hz, progressive
mode 20: 1920x1080 @ 50Hz, interlaced
pi@raspberrypi:~$ /opt/vc/bin/tvservice -s
state 0x12001a, 1280x720 @ 60Hz, progressive