Commit bfbbf137 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Update

parent b0b43042
......@@ -519,13 +519,13 @@ endif
ifeq ($(HAVE_GL), 1)
ifeq ($(HAVE_GLES),1)
RZDCY_CFLAGS += -DGLES -DHAVE_OPENGLES2
CXXFLAGS += -DGLES -DHAVE_OPENGLES2
CFLAGS += -DGLES -DHAVE_OPENGLES2
RZDCY_CFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2
CXXFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2
CFLAGS += -DHAVE_OPENGLES -DHAVE_OPENGLES2
else
RZDCY_CFLAGS += -DGL
CXXFLAGS += -DGL
CFLAGS += -DGL
RZDCY_CFLAGS += -DHAVE_OPENGL
CXXFLAGS += -DHAVE_OPENGL
CFLAGS += -DHAVE_OPENGL
endif
endif
......
......@@ -170,7 +170,7 @@ static struct gl_cached_state gl_state;
void rglClearDepth(GLdouble depth)
{
glsm_ctl(GLSM_CTL_IMM_VBO_DRAW, NULL);
#ifdef GLES
#ifdef HAVE_OPENGLES
glClearDepthf(depth);
#else
glClearDepth(depth);
......@@ -181,7 +181,7 @@ void rglClearDepth(GLdouble depth)
void rglDepthRange(GLclampd zNear, GLclampd zFar)
{
#ifdef GLES
#ifdef HAVE_OPENGLES
glDepthRangef(zNear, zFar);
#else
glDepthRange(zNear, zFar);
......@@ -459,7 +459,9 @@ GLenum rglCheckFramebufferStatus(GLenum target)
void rglBindFragDataLocation(GLuint program, GLuint colorNumber,
const char * name)
{
#if !defined(HAVE_OPENGLES2)
glBindFragDataLocation(program, colorNumber, name);
#endif
}
void rglBindAttribLocation(GLuint program, GLuint index, const GLchar *name)
......@@ -864,12 +866,12 @@ static bool glsm_state_ctx_init(void *data)
if (!params || !params->environ_cb)
return false;
#ifdef GLES
#if defined(GLES31)
#ifdef HAVE_OPENGLES
#if defined(HAVE_OPENGLES31)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES_VERSION;
hw_render.version_major = 3;
hw_render.version_minor = 1;
#elif defined(GLES3)
#elif defined(HAVE_OPENGLES3)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES3;
#else
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
......
......@@ -6,10 +6,10 @@
#include "../hw/pvr/pvr_regs.h"
#if defined(GL) || defined(GLES)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
#include <glsm/glsm.h>
#include "../rend/rend.h"
#endif
#include "../rend/rend.h"
#include "libretro.h"
......@@ -382,7 +382,7 @@ void retro_run (void)
update_variables();
co_dc_run();
#if defined(GL) || defined(GLES)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
video_cb(is_dupe ? 0 : RETRO_HW_FRAME_BUFFER_VALID, screen_width, screen_height, 0);
#endif
is_dupe = true;
......@@ -393,7 +393,7 @@ void retro_reset (void)
//TODO
}
#if defined(GL) || defined(GLES)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
static void context_reset(void)
{
printf("context_reset.\n");
......@@ -525,7 +525,7 @@ bool retro_load_game(const struct retro_game_info *game)
if (!boot_to_bios)
game_data = strdup(game->path);
#if defined(GL) || defined(GLES)
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
params.context_reset = context_reset;
params.context_destroy = context_destroy;
params.environ_cb = environ_cb;
......
......@@ -181,7 +181,7 @@ float fb_scale_x,fb_scale_y;
#define FRAGCOL "gl_FragColor"
#define TEXLOOKUP "texture2D"
#ifdef GLES
#ifdef HAVE_OPENGLES
#define HIGHP "highp"
#define MEDIUMP "mediump"
#define LOWP "lowp"
......@@ -194,7 +194,7 @@ float fb_scale_x,fb_scale_y;
//Fragment and vertex shaders code
//pretty much 1:1 copy of the d3d ones for now
const char* VertexShaderSource =
#ifndef GLES
#ifndef HAVE_OPENGLES
"#version 120 \n"
#endif
"\
......@@ -228,7 +228,7 @@ void main() \n\
}";
const char* PixelPipelineShader =
#ifndef GLES
#ifndef HAVE_OPENGLES
"#version 120 \n"
#endif
"\
......@@ -445,7 +445,7 @@ static GLuint gl_CompileAndLink(const char* VertexShader, const char* FragmentSh
glBindAttribLocation(program, VERTEX_COL_OFFS_ARRAY, "in_offs");
glBindAttribLocation(program, VERTEX_UV_ARRAY, "in_uv");
#ifndef GLES
#ifndef HAVE_OPENGLES
glBindFragDataLocation(program, 0, "FragColor");
#endif
......@@ -1892,11 +1892,7 @@ static bool RenderFrame(void)
}
glClearColor(0, 0, 0, 1.0f);
#ifdef GLES
glClearDepthf(0.f);
#else
glClearDepth(0.f);
#endif
glClearDepth(0.f);
glViewport(0, 0, gles_screen_width, gles_screen_height);
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
......
......@@ -178,7 +178,7 @@ struct TextureCacheData
SetRepeatMode(GL_TEXTURE_WRAP_S, tsp.ClampU, tsp.FlipU);
SetRepeatMode(GL_TEXTURE_WRAP_T, tsp.ClampV, tsp.FlipV);
#ifdef GLES
#ifdef HAVE_OPENGLES
glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment