Przeglądaj źródła

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.
legacy
Sam Hocevar sam 13 lat temu
rodzic
commit
c968144c69
2 zmienionych plików z 13 dodań i 4 usunięć
  1. +9
    -0
      src/ps3app.cpp
  2. +4
    -4
      src/video.cpp

+ 9
- 0
src/ps3app.cpp Wyświetl plik

@@ -13,6 +13,7 @@
#endif

#if defined __CELLOS_LV2__
# include <sys/ppu_thread.h> /* sys_ppu_thread_get_stack_information */
# include <sys/spu_initialize.h>
# include <sys/paths.h> /* SYS_HOST_ROOT */
# include <cell/sysmodule.h>
@@ -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);


+ 4
- 4
src/video.cpp Wyświetl plik

@@ -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);


Ładowanie…
Anuluj
Zapisz