Permalink
Browse files

Merge branch 'align-glide-upstream'

  • Loading branch information...
littleguy77 committed Jan 3, 2015
2 parents d02e847 + 47d3c9e commit 3beac96a5c2d61d1f3f07d5ab4de57230575cc1b
@@ -1479,9 +1479,17 @@ EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front)
BYTE *ptr = (BYTE*) info.lfbPtr + (info.strideInBytes * y);
for (wxUint32 x=0; x<settings.res_x; x++)
{
+#ifdef USE_GLES
+ // GLESv2 only guarantees support for GL_RGBA pixel format
line[x*3] = ptr[0]; // red
line[x*3+1] = ptr[1]; // green
line[x*3+2] = ptr[2]; // blue
+#else
+ // OpenGL guarantees support for GL_BGRA pixel format
+ line[x*3] = ptr[2]; // red
+ line[x*3+1] = ptr[1]; // green
+ line[x*3+2] = ptr[0]; // blue
+#endif
ptr += 4;
}
line += settings.res_x * 3;
@@ -39,13 +39,16 @@
#include "main.h"
#include "m64p.h"
+#include <SDL_opengles2.h>
+
#define OPENGL_CHECK_ERRORS { const GLenum errcode = glGetError(); if (errcode != GL_NO_ERROR) LOG("OpenGL Error code %i in '%s' line %i\n", errcode, __FILE__, __LINE__-1); }
#ifdef VPDEBUG
#include <IL/il.h>
#endif
extern void (*renderCallback)(int);
+void vbo_draw();
wrapper_config config = {0, 0, 0, 0};
int screen_width, screen_height;
@@ -203,8 +206,8 @@ struct texbuf_t {
static texbuf_t texbufs[NB_TEXBUFS];
static int texbuf_i;
-unsigned short frameBuffer[2048*2048*4];
-unsigned short depthBuffer[2048*2048];
+unsigned short frameBuffer[2048*2048*2]; // Support 2048x2048 screen resolution at 32 bits (RGBA) per pixel
+unsigned short depthBuffer[2048*2048]; // Support 2048x2048 screen resolution at 16 bits (depth) per pixel
//#define VOODOO1
@@ -348,6 +351,7 @@ grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy )
glScissor(minx, miny+viewport_offset, maxx - minx, maxy - miny);
//printf("gl scissor %d %d %d %d\n", minx, miny, maxx, maxy);
} else {
+ vbo_draw();
glScissor(minx, (viewport_offset)+height-maxy, maxx - minx, maxy - miny);
}
glEnable(GL_SCISSOR_TEST);
@@ -200,8 +200,8 @@ struct texbuf_t {
static texbuf_t texbufs[NB_TEXBUFS];
static int texbuf_i;
-unsigned short frameBuffer[2048*2048];
-unsigned short depthBuffer[2048*2048];
+unsigned short frameBuffer[2048*2048*2]; // Support 2048x2048 screen resolution at 32 bits (RGBA) per pixel
+unsigned short depthBuffer[2048*2048]; // Support 2048x2048 screen resolution at 16 bits (depth) per pixel
//#define VOODOO1
Oops, something went wrong.

0 comments on commit 3beac96

Please sign in to comment.