From c968144c697e8556d16cc3d04d1ea66f01d6e9aa Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 12 Aug 2011 16:33:15 +0000 Subject: [PATCH] ps3: until we know how to retrieve and change the screen resolution from within the Video class, just store what the GL context tells us and stick to that. --- src/ps3app.cpp | 9 +++++++++ src/video.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ps3app.cpp b/src/ps3app.cpp index 56b61433..d75999cd 100644 --- a/src/ps3app.cpp +++ b/src/ps3app.cpp @@ -13,6 +13,7 @@ #endif #if defined __CELLOS_LV2__ +# include /* sys_ppu_thread_get_stack_information */ # include # include /* SYS_HOST_ROOT */ # include @@ -78,10 +79,18 @@ Ps3App::Ps3App(char const *title, vec2i res, float fps) : psglInit(&psglio); +#if 0 + sys_ppu_thread_stack_t stack; + sys_ppu_thread_get_stack_information(&stack); + printf("stack starts at %p, ends at %p\n", stack.pst_addr, + (uint8_t *)stack.pst_addr + stack.pst_size); +#endif + PSGLdevice* psgl = psglCreateDeviceAuto(GL_ARGB_SCE, GL_DEPTH_COMPONENT24, GL_MULTISAMPLING_4X_SQUARE_ROTATED_SCE); GLuint w, h; psglGetDeviceDimensions(psgl, &w, &h); + res = vec2i(w, h); PSGLcontext *ctx = psglCreateContext(); psglMakeCurrent(ctx, psgl); diff --git a/src/video.cpp b/src/video.cpp index eb63257c..2d1c82d3 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -33,7 +33,7 @@ class VideoData private: static mat4 proj_matrix, view_matrix; -#if defined ANDROID_NDK +#if defined ANDROID_NDK || defined __CELLOS_LV2__ static vec2i saved_viewport; #endif }; @@ -41,7 +41,7 @@ private: mat4 VideoData::proj_matrix; mat4 VideoData::view_matrix; -#if defined ANDROID_NDK +#if defined ANDROID_NDK || defined __CELLOS_LV2__ vec2i VideoData::saved_viewport = 0; #endif @@ -64,7 +64,7 @@ void Video::Setup(vec2i size) /* Initialise OpenGL */ glViewport(0, 0, size.x, size.y); -#if defined ANDROID_NDK +#if defined ANDROID_NDK || defined __CELLOS_LV2__ VideoData::saved_viewport = size; #endif @@ -182,7 +182,7 @@ vec2i Video::GetSize() return VideoData::saved_viewport; #elif defined __CELLOS_LV2__ // FIXME: use psglCreateDeviceAuto && psglGetDeviceDimensions - return vec2i(1920, 1080); + return VideoData::saved_viewport; #else GLint v[4]; glGetIntegerv(GL_VIEWPORT, v);