Fixup build for PC.

This commit is contained in:
Themaister 2012-09-13 19:41:41 +02:00
parent 655006984e
commit df69517d79

View File

@ -61,11 +61,9 @@
#define NO_GL_CLAMP_TO_BORDER #define NO_GL_CLAMP_TO_BORDER
#endif #endif
// FIXME: Support GL_TRIANGLE_STRIP in RGL.
#if defined(HAVE_PSGL) #if defined(HAVE_PSGL)
#define VERTEX_RENDER_MODE GL_QUADS
#ifndef GL_RENDER_MODE
#define GL_RENDER_MODE GL_QUADS
#endif
// Used for the last pass when rendering to the back buffer. // Used for the last pass when rendering to the back buffer.
const GLfloat vertexes_flipped[] = { const GLfloat vertexes_flipped[] = {
@ -100,11 +98,7 @@ static inline void set_texture_coords(GLfloat *coords, GLfloat xamt, GLfloat yam
} }
#else #else
#define VERTEX_RENDER_MODE GL_TRIANGLE_STRIP
#ifndef GL_RENDER_MODE
#define GL_RENDER_MODE GL_TRIANGLE_STRIP
#endif
// Used for the last pass when rendering to the back buffer. // Used for the last pass when rendering to the back buffer.
const GLfloat vertexes_flipped[] = { const GLfloat vertexes_flipped[] = {
0, 1, 0, 1,
@ -133,11 +127,9 @@ static inline void set_texture_coords(GLfloat *coords, GLfloat xamt, GLfloat yam
{ {
coords[2] = xamt; coords[2] = xamt;
coords[6] = xamt; coords[6] = xamt;
coords[5] = yamt; coords[5] = yamt;
coords[7] = yamt; coords[7] = yamt;
} }
#endif #endif
const GLfloat white_color[] = { const GLfloat white_color[] = {
@ -806,7 +798,7 @@ static void gl_frame_fbo(gl_t *gl, const struct gl_tex_info *tex_info)
tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt); tex_info, gl->prev_info, fbo_tex_info, fbo_tex_info_cnt);
gl_shader_set_coords(&gl->coords, &gl->mvp); gl_shader_set_coords(&gl->coords, &gl->mvp);
glDrawArrays(GL_RENDER_MODE, 0, 4); glDrawArrays(VERTEX_RENDER_MODE, 0, 4);
fbo_tex_info_cnt++; fbo_tex_info_cnt++;
} }
@ -835,7 +827,7 @@ static void gl_frame_fbo(gl_t *gl, const struct gl_tex_info *tex_info)
gl->coords.vertex = vertex_ptr; gl->coords.vertex = vertex_ptr;
gl_shader_set_coords(&gl->coords, &gl->mvp); gl_shader_set_coords(&gl->coords, &gl->mvp);
glDrawArrays(GL_RENDER_MODE, 0, 4); glDrawArrays(VERTEX_RENDER_MODE, 0, 4);
gl->coords.tex_coord = gl->tex_coords; gl->coords.tex_coord = gl->tex_coords;
} }
@ -1080,7 +1072,7 @@ static void gl_render_menu(gl_t *gl)
gl->coords.vertex = default_vertex_ptr; gl->coords.vertex = default_vertex_ptr;
gl_shader_set_coords(&gl->coords, &gl->mvp); gl_shader_set_coords(&gl->coords, &gl->mvp);
glDrawArrays(GL_RENDER_MODE, 0, 4); glDrawArrays(VERTEX_RENDER_MODE, 0, 4);
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]); glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
} }
@ -1138,7 +1130,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
&tex_info, gl->prev_info, NULL, 0); &tex_info, gl->prev_info, NULL, 0);
gl_shader_set_coords(&gl->coords, &gl->mvp); gl_shader_set_coords(&gl->coords, &gl->mvp);
glDrawArrays(GL_RENDER_MODE, 0, 4); glDrawArrays(VERTEX_RENDER_MODE, 0, 4);
#ifdef HAVE_FBO #ifdef HAVE_FBO
if (gl->fbo_inited) if (gl->fbo_inited)
@ -1244,7 +1236,7 @@ static bool resolve_extensions(gl_t *gl)
gl->border_type = GL_CLAMP_TO_BORDER; gl->border_type = GL_CLAMP_TO_BORDER;
#endif #endif
#if defined(HAVE_PBO) && defined(ANDROID) #if defined(HAVE_PBO)
RARCH_LOG("[GL]: Using PBOs.\n"); RARCH_LOG("[GL]: Using PBOs.\n");
if (!gl_query_extension("GL_ARB_pixel_buffer_object")) if (!gl_query_extension("GL_ARB_pixel_buffer_object"))
{ {