Merge commit '3997b59cd652c7852f866aa11c25693fab6bbcda'

This commit is contained in:
twinaphex 2018-06-17 20:04:50 +02:00
commit fa1ec0780b
2 changed files with 113 additions and 94 deletions

View File

@ -163,7 +163,7 @@ struct gl_cached_state
GLenum mode; GLenum mode;
} frontface; } frontface;
struct struct
{ {
bool used; bool used;
GLenum mode; GLenum mode;
@ -189,14 +189,14 @@ struct gl_cached_state
GLuint vao; GLuint vao;
GLuint framebuf; GLuint framebuf;
GLuint array_buffer; GLuint array_buffer;
GLuint program; GLuint program;
GLenum active_texture; GLenum active_texture;
int cap_state[SGL_CAP_MAX]; int cap_state[SGL_CAP_MAX];
int cap_translate[SGL_CAP_MAX]; int cap_translate[SGL_CAP_MAX];
}; };
static GLint glsm_max_textures; static GLint glsm_max_textures;
static struct retro_hw_render_callback hw_render; struct retro_hw_render_callback hw_render;
static struct gl_cached_state gl_state; static struct gl_cached_state gl_state;
/* GL wrapper-side */ /* GL wrapper-side */
@ -359,7 +359,7 @@ void rglFrontFace(GLenum mode)
glsm_ctl(GLSM_CTL_IMM_VBO_DRAW, NULL); glsm_ctl(GLSM_CTL_IMM_VBO_DRAW, NULL);
glFrontFace(mode); glFrontFace(mode);
gl_state.frontface.used = true; gl_state.frontface.used = true;
gl_state.frontface.mode = mode; gl_state.frontface.mode = mode;
} }
/* /*
@ -520,7 +520,7 @@ void rglBlendFuncSeparate(GLenum sfactor, GLenum dfactor)
* Category: Textures * Category: Textures
* *
* Core in: * Core in:
* OpenGL : 1.3 * OpenGL : 1.3
*/ */
void rglActiveTexture(GLenum texture) void rglActiveTexture(GLenum texture)
{ {
@ -569,7 +569,7 @@ void rglEnable(GLenum cap)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUseProgram(GLuint program) void rglUseProgram(GLuint program)
{ {
@ -653,7 +653,7 @@ void rglLinkProgram(GLuint program)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglFramebufferTexture2D(GLenum target, GLenum attachment, void rglFramebufferTexture2D(GLenum target, GLenum attachment,
@ -702,7 +702,7 @@ void rglCompressedTexImage2D(GLenum target, GLint level,
GLenum internalformat, GLsizei width, GLsizei height, GLenum internalformat, GLsizei width, GLsizei height,
GLint border, GLsizei imageSize, const GLvoid *data) GLint border, GLsizei imageSize, const GLvoid *data)
{ {
glCompressedTexImage2D(target, level, internalformat, glCompressedTexImage2D(target, level, internalformat,
width, height, border, imageSize, data); width, height, border, imageSize, data);
} }
@ -720,7 +720,7 @@ void rglDeleteTextures(GLsizei n, const GLuint *textures)
/* /*
* *
* Core in: * Core in:
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglRenderbufferStorage(GLenum target, GLenum internalFormat, void rglRenderbufferStorage(GLenum target, GLenum internalFormat,
GLsizei width, GLsizei height) GLsizei width, GLsizei height)
@ -733,7 +733,7 @@ void rglRenderbufferStorage(GLenum target, GLenum internalFormat,
* Core in: * Core in:
* *
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglBindRenderbuffer(GLenum target, GLuint renderbuffer) void rglBindRenderbuffer(GLenum target, GLuint renderbuffer)
{ {
@ -744,7 +744,7 @@ void rglBindRenderbuffer(GLenum target, GLuint renderbuffer)
* *
* Core in: * Core in:
* *
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) void rglDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers)
{ {
@ -756,7 +756,7 @@ void rglDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers)
* Core in: * Core in:
* *
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglGenRenderbuffers(GLsizei n, GLuint *renderbuffers) void rglGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
{ {
@ -768,7 +768,7 @@ void rglGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
* Core in: * Core in:
* *
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglGenerateMipmap(GLenum target) void rglGenerateMipmap(GLenum target)
{ {
@ -779,7 +779,7 @@ void rglGenerateMipmap(GLenum target)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
*/ */
GLenum rglCheckFramebufferStatus(GLenum target) GLenum rglCheckFramebufferStatus(GLenum target)
{ {
@ -790,7 +790,7 @@ GLenum rglCheckFramebufferStatus(GLenum target)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 2.0 * OpenGLES : 2.0
*/ */
void rglFramebufferRenderbuffer(GLenum target, GLenum attachment, void rglFramebufferRenderbuffer(GLenum target, GLenum attachment,
@ -803,7 +803,7 @@ void rglFramebufferRenderbuffer(GLenum target, GLenum attachment,
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
*/ */
void rglBindFragDataLocation(GLuint program, GLuint colorNumber, void rglBindFragDataLocation(GLuint program, GLuint colorNumber,
const char * name) const char * name)
@ -818,7 +818,7 @@ void rglBindFragDataLocation(GLuint program, GLuint colorNumber,
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglGetProgramiv(GLuint shader, GLenum pname, GLint *params) void rglGetProgramiv(GLuint shader, GLenum pname, GLint *params)
{ {
@ -829,7 +829,7 @@ void rglGetProgramiv(GLuint shader, GLenum pname, GLint *params)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 4.1 * OpenGL : 4.1
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglProgramParameteri( GLuint program, void rglProgramParameteri( GLuint program,
@ -846,7 +846,7 @@ void rglProgramParameteri( GLuint program,
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, void rglGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize,
GLsizei *length, GLint *size, GLenum *type, GLchar *name) GLsizei *length, GLint *size, GLenum *type, GLchar *name)
@ -859,7 +859,7 @@ void rglGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize,
* *
* Core in: * Core in:
* *
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglGetActiveUniformBlockiv(GLuint program, void rglGetActiveUniformBlockiv(GLuint program,
@ -973,7 +973,7 @@ void rglUniformBlockBinding( GLuint program,
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglUniform1ui(GLint location, GLuint v) void rglUniform1ui(GLint location, GLuint v)
@ -986,7 +986,7 @@ void rglUniform1ui(GLint location, GLuint v)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglUniform2ui(GLint location, GLuint v0, GLuint v1) void rglUniform2ui(GLint location, GLuint v0, GLuint v1)
@ -999,7 +999,7 @@ void rglUniform2ui(GLint location, GLuint v0, GLuint v1)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) void rglUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
@ -1012,7 +1012,7 @@ void rglUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) void rglUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
@ -1025,7 +1025,7 @@ void rglUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, void rglUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
const GLfloat *value) const GLfloat *value)
@ -1037,7 +1037,7 @@ void rglUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglDetachShader(GLuint program, GLuint shader) void rglDetachShader(GLuint program, GLuint shader)
{ {
@ -1048,7 +1048,7 @@ void rglDetachShader(GLuint program, GLuint shader)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglGetShaderiv(GLuint shader, GLenum pname, GLint *params) void rglGetShaderiv(GLuint shader, GLenum pname, GLint *params)
{ {
@ -1059,7 +1059,7 @@ void rglGetShaderiv(GLuint shader, GLenum pname, GLint *params)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglAttachShader(GLuint program, GLuint shader) void rglAttachShader(GLuint program, GLuint shader)
{ {
@ -1069,7 +1069,7 @@ void rglAttachShader(GLuint program, GLuint shader)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
GLint rglGetAttribLocation(GLuint program, const GLchar *name) GLint rglGetAttribLocation(GLuint program, const GLchar *name)
{ {
@ -1080,7 +1080,7 @@ GLint rglGetAttribLocation(GLuint program, const GLchar *name)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglShaderSource(GLuint shader, GLsizei count, void rglShaderSource(GLuint shader, GLsizei count,
const GLchar **string, const GLint *length) const GLchar **string, const GLint *length)
@ -1092,7 +1092,7 @@ void rglShaderSource(GLuint shader, GLsizei count,
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglCompileShader(GLuint shader) void rglCompileShader(GLuint shader)
{ {
@ -1103,7 +1103,7 @@ void rglCompileShader(GLuint shader)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
GLuint rglCreateProgram(void) GLuint rglCreateProgram(void)
{ {
@ -1113,7 +1113,7 @@ GLuint rglCreateProgram(void)
/* /*
* *
* Core in: * Core in:
* OpenGL : 1.1 * OpenGL : 1.1
*/ */
void rglGenTextures(GLsizei n, GLuint *textures) void rglGenTextures(GLsizei n, GLuint *textures)
{ {
@ -1123,7 +1123,7 @@ void rglGenTextures(GLsizei n, GLuint *textures)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglGetShaderInfoLog(GLuint shader, GLsizei maxLength, void rglGetShaderInfoLog(GLuint shader, GLsizei maxLength,
GLsizei *length, GLchar *infoLog) GLsizei *length, GLchar *infoLog)
@ -1134,7 +1134,7 @@ void rglGetShaderInfoLog(GLuint shader, GLsizei maxLength,
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglGetProgramInfoLog(GLuint shader, GLsizei maxLength, void rglGetProgramInfoLog(GLuint shader, GLsizei maxLength,
GLsizei *length, GLchar *infoLog) GLsizei *length, GLchar *infoLog)
@ -1145,7 +1145,7 @@ void rglGetProgramInfoLog(GLuint shader, GLsizei maxLength,
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
GLboolean rglIsProgram(GLuint program) GLboolean rglIsProgram(GLuint program)
{ {
@ -1164,7 +1164,7 @@ void rglTexCoord2f(GLfloat s, GLfloat t)
* Category: Generic vertex attributes * Category: Generic vertex attributes
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* *
*/ */
void rglDisableVertexAttribArray(GLuint index) void rglDisableVertexAttribArray(GLuint index)
@ -1177,7 +1177,7 @@ void rglDisableVertexAttribArray(GLuint index)
* Category: Generic vertex attributes * Category: Generic vertex attributes
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglEnableVertexAttribArray(GLuint index) void rglEnableVertexAttribArray(GLuint index)
{ {
@ -1190,7 +1190,7 @@ void rglEnableVertexAttribArray(GLuint index)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglVertexAttribIPointer( void rglVertexAttribIPointer(
GLuint index, GLuint index,
@ -1220,7 +1220,7 @@ void rglVertexAttribLPointer(
* Category: Generic vertex attributes * Category: Generic vertex attributes
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglVertexAttribPointer(GLuint name, GLint size, void rglVertexAttribPointer(GLuint name, GLint size,
GLenum type, GLboolean normalized, GLsizei stride, GLenum type, GLboolean normalized, GLsizei stride,
@ -1240,7 +1240,7 @@ void rglVertexAttribPointer(GLuint name, GLint size,
* Category: Generic vertex attributes * Category: Generic vertex attributes
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglBindAttribLocation(GLuint program, GLuint index, const GLchar *name) void rglBindAttribLocation(GLuint program, GLuint index, const GLchar *name)
{ {
@ -1250,7 +1250,7 @@ void rglBindAttribLocation(GLuint program, GLuint index, const GLchar *name)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglVertexAttrib4f(GLuint name, GLfloat x, GLfloat y, void rglVertexAttrib4f(GLuint name, GLfloat x, GLfloat y,
GLfloat z, GLfloat w) GLfloat z, GLfloat w)
@ -1261,7 +1261,7 @@ void rglVertexAttrib4f(GLuint name, GLfloat x, GLfloat y,
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglVertexAttrib4fv(GLuint name, GLfloat* v) void rglVertexAttrib4fv(GLuint name, GLfloat* v)
{ {
@ -1272,7 +1272,7 @@ void rglVertexAttrib4fv(GLuint name, GLfloat* v)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
GLuint rglCreateShader(GLenum shaderType) GLuint rglCreateShader(GLenum shaderType)
{ {
@ -1283,7 +1283,7 @@ GLuint rglCreateShader(GLenum shaderType)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglDeleteProgram(GLuint program) void rglDeleteProgram(GLuint program)
{ {
@ -1294,7 +1294,7 @@ void rglDeleteProgram(GLuint program)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglDeleteShader(GLuint shader) void rglDeleteShader(GLuint shader)
{ {
@ -1305,7 +1305,7 @@ void rglDeleteShader(GLuint shader)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
GLint rglGetUniformLocation(GLuint program, const GLchar *name) GLint rglGetUniformLocation(GLuint program, const GLchar *name)
{ {
@ -1316,7 +1316,7 @@ GLint rglGetUniformLocation(GLuint program, const GLchar *name)
* Category: VBO and PBO * Category: VBO and PBO
* *
* Core in: * Core in:
* OpenGL : 1.5 * OpenGL : 1.5
*/ */
void rglDeleteBuffers(GLsizei n, const GLuint *buffers) void rglDeleteBuffers(GLsizei n, const GLuint *buffers)
{ {
@ -1327,7 +1327,7 @@ void rglDeleteBuffers(GLsizei n, const GLuint *buffers)
* Category: VBO and PBO * Category: VBO and PBO
* *
* Core in: * Core in:
* OpenGL : 1.5 * OpenGL : 1.5
*/ */
void rglGenBuffers(GLsizei n, GLuint *buffers) void rglGenBuffers(GLsizei n, GLuint *buffers)
{ {
@ -1338,7 +1338,7 @@ void rglGenBuffers(GLsizei n, GLuint *buffers)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform1f(GLint location, GLfloat v0) void rglUniform1f(GLint location, GLfloat v0)
{ {
@ -1349,7 +1349,7 @@ void rglUniform1f(GLint location, GLfloat v0)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform1fv(GLint location, GLsizei count, const GLfloat *value) void rglUniform1fv(GLint location, GLsizei count, const GLfloat *value)
{ {
@ -1360,7 +1360,7 @@ void rglUniform1fv(GLint location, GLsizei count, const GLfloat *value)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform1iv(GLint location, GLsizei count, const GLint *value) void rglUniform1iv(GLint location, GLsizei count, const GLint *value)
{ {
@ -1386,7 +1386,7 @@ void rglTexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
const GLubyte* rglGetStringi(GLenum name, GLuint index) const GLubyte* rglGetStringi(GLenum name, GLuint index)
@ -1411,7 +1411,7 @@ void rglClearBufferfi( GLenum buffer,
/* /*
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglRenderbufferStorageMultisample( GLenum target, void rglRenderbufferStorageMultisample( GLenum target,
@ -1429,7 +1429,7 @@ void rglRenderbufferStorageMultisample( GLenum target,
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform1i(GLint location, GLint v0) void rglUniform1i(GLint location, GLint v0)
{ {
@ -1440,7 +1440,7 @@ void rglUniform1i(GLint location, GLint v0)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform2f(GLint location, GLfloat v0, GLfloat v1) void rglUniform2f(GLint location, GLfloat v0, GLfloat v1)
{ {
@ -1451,7 +1451,7 @@ void rglUniform2f(GLint location, GLfloat v0, GLfloat v1)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform2i(GLint location, GLint v0, GLint v1) void rglUniform2i(GLint location, GLint v0, GLint v1)
{ {
@ -1462,7 +1462,7 @@ void rglUniform2i(GLint location, GLint v0, GLint v1)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform2fv(GLint location, GLsizei count, const GLfloat *value) void rglUniform2fv(GLint location, GLsizei count, const GLfloat *value)
{ {
@ -1473,7 +1473,7 @@ void rglUniform2fv(GLint location, GLsizei count, const GLfloat *value)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) void rglUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{ {
@ -1484,7 +1484,7 @@ void rglUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform3fv(GLint location, GLsizei count, const GLfloat *value) void rglUniform3fv(GLint location, GLsizei count, const GLfloat *value)
{ {
@ -1506,7 +1506,7 @@ void rglUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) void rglUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{ {
@ -1517,7 +1517,7 @@ void rglUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3
* Category: Shaders * Category: Shaders
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglUniform4fv(GLint location, GLsizei count, const GLfloat *value) void rglUniform4fv(GLint location, GLsizei count, const GLfloat *value)
{ {
@ -1528,7 +1528,7 @@ void rglUniform4fv(GLint location, GLsizei count, const GLfloat *value)
/* /*
* *
* Core in: * Core in:
* OpenGL : 1.0 * OpenGL : 1.0
*/ */
void rglPolygonOffset(GLfloat factor, GLfloat units) void rglPolygonOffset(GLfloat factor, GLfloat units)
{ {
@ -1543,7 +1543,7 @@ void rglPolygonOffset(GLfloat factor, GLfloat units)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
*/ */
void rglGenFramebuffers(GLsizei n, GLuint *ids) void rglGenFramebuffers(GLsizei n, GLuint *ids)
{ {
@ -1554,7 +1554,7 @@ void rglGenFramebuffers(GLsizei n, GLuint *ids)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
*/ */
void rglBindFramebuffer(GLenum target, GLuint framebuffer) void rglBindFramebuffer(GLenum target, GLuint framebuffer)
{ {
@ -1567,7 +1567,7 @@ void rglBindFramebuffer(GLenum target, GLuint framebuffer)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglDrawBuffers(GLsizei n, const GLenum *bufs) void rglDrawBuffers(GLsizei n, const GLenum *bufs)
@ -1581,7 +1581,7 @@ void rglDrawBuffers(GLsizei n, const GLenum *bufs)
* Category: FBO * Category: FBO
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void *rglMapBufferRange( GLenum target, void *rglMapBufferRange( GLenum target,
@ -1629,7 +1629,7 @@ void rglTexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat,
/* /*
* *
* Core in: * Core in:
* OpenGL : 4.2 * OpenGL : 4.2
* OpenGLES : 3.1 * OpenGLES : 3.1
*/ */
void rglMemoryBarrier( GLbitfield barriers) void rglMemoryBarrier( GLbitfield barriers)
@ -1644,7 +1644,7 @@ void rglMemoryBarrier( GLbitfield barriers)
/* /*
* *
* Core in: * Core in:
* OpenGL : 4.2 * OpenGL : 4.2
* OpenGLES : 3.1 * OpenGLES : 3.1
*/ */
void rglBindImageTexture( GLuint unit, void rglBindImageTexture( GLuint unit,
@ -1714,7 +1714,7 @@ void rglTexImage2DMultisample( GLenum target,
/* /*
* *
* Core in: * Core in:
* OpenGL : 1.5 * OpenGL : 1.5
*/ */
void * rglMapBuffer( GLenum target, GLenum access) void * rglMapBuffer( GLenum target, GLenum access)
{ {
@ -1728,7 +1728,7 @@ void * rglMapBuffer( GLenum target, GLenum access)
/* /*
* *
* Core in: * Core in:
* OpenGL : 1.5 * OpenGL : 1.5
*/ */
GLboolean rglUnmapBuffer( GLenum target) GLboolean rglUnmapBuffer( GLenum target)
{ {
@ -1753,7 +1753,7 @@ void rglBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
* Category: Blending * Category: Blending
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
*/ */
void rglBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) void rglBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{ {
@ -1763,7 +1763,7 @@ void rglBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
/* /*
* *
* Core in: * Core in:
* OpenGL : 2.0 * OpenGL : 2.0
* OpenGLES : 3.2 * OpenGLES : 3.2
*/ */
void rglCopyImageSubData( GLuint srcName, void rglCopyImageSubData( GLuint srcName,
@ -1805,7 +1805,7 @@ void rglCopyImageSubData( GLuint srcName,
* Category: VAO * Category: VAO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglBindVertexArray(GLuint array) void rglBindVertexArray(GLuint array)
@ -1819,7 +1819,7 @@ void rglBindVertexArray(GLuint array)
* Category: VAO * Category: VAO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglGenVertexArrays(GLsizei n, GLuint *arrays) void rglGenVertexArrays(GLsizei n, GLuint *arrays)
@ -1833,7 +1833,7 @@ void rglGenVertexArrays(GLsizei n, GLuint *arrays)
* Category: VAO * Category: VAO
* *
* Core in: * Core in:
* OpenGL : 3.0 * OpenGL : 3.0
* OpenGLES : 3.0 * OpenGLES : 3.0
*/ */
void rglDeleteVertexArrays(GLsizei n, const GLuint *arrays) void rglDeleteVertexArrays(GLsizei n, const GLuint *arrays)
@ -1973,7 +1973,7 @@ static void glsm_state_setup(void)
gl_state.framebuf = hw_render.get_current_framebuffer(); gl_state.framebuf = hw_render.get_current_framebuffer();
gl_state.cullface.mode = GL_BACK; gl_state.cullface.mode = GL_BACK;
gl_state.frontface.mode = GL_CCW; gl_state.frontface.mode = GL_CCW;
gl_state.blendfunc_separate.used = false; gl_state.blendfunc_separate.used = false;
gl_state.blendfunc_separate.srcRGB = GL_ONE; gl_state.blendfunc_separate.srcRGB = GL_ONE;
@ -1982,7 +1982,7 @@ static void glsm_state_setup(void)
gl_state.blendfunc_separate.dstAlpha = GL_ZERO; gl_state.blendfunc_separate.dstAlpha = GL_ZERO;
gl_state.depthfunc.used = false; gl_state.depthfunc.used = false;
gl_state.colormask.used = false; gl_state.colormask.used = false;
gl_state.colormask.red = GL_TRUE; gl_state.colormask.red = GL_TRUE;
gl_state.colormask.green = GL_TRUE; gl_state.colormask.green = GL_TRUE;

View File

@ -857,26 +857,39 @@ enum retro_mod
#define RETRO_ENVIRONMENT_SET_CONTROLLER_INFO 35 #define RETRO_ENVIRONMENT_SET_CONTROLLER_INFO 35
/* const struct retro_controller_info * -- /* const struct retro_controller_info * --
* This environment call lets a libretro core tell the frontend * This environment call lets a libretro core tell the frontend
* which controller types are recognized in calls to * which controller subclasses are recognized in calls to
* retro_set_controller_port_device(). * retro_set_controller_port_device().
* *
* Some emulators such as Super Nintendo * Some emulators such as Super Nintendo support multiple lightgun
* support multiple lightgun types which must be specifically * types which must be specifically selected from. It is therefore
* selected from. * sometimes necessary for a frontend to be able to tell the core
* It is therefore sometimes necessary for a frontend to be able * about a special kind of input device which is not specifcally
* to tell the core about a special kind of input device which is * provided by the Libretro API.
* not covered by the libretro input API.
* *
* In order for a frontend to understand the workings of an input device, * In order for a frontend to understand the workings of those devices,
* it must be a specialized type * they must be defined as a specialized subclass of the generic device
* of the generic device types already defined in the libretro API. * types already defined in the libretro API.
* *
* Which devices are supported can vary per input port.
* The core must pass an array of const struct retro_controller_info which * The core must pass an array of const struct retro_controller_info which
* is terminated with a blanked out struct. Each element of the struct * is terminated with a blanked out struct. Each element of the
* corresponds to an ascending port index to * retro_controller_info struct corresponds to the ascending port index
* retro_set_controller_port_device(). * that is passed to retro_set_controller_port_device() when that function
* Even if special device types are set in the libretro core, * is called to indicate to the core that the frontend has changed the
* active device subclass. SEE ALSO: retro_set_controller_port_device()
*
* The ascending input port indexes provided by the core in the struct
* are generally presented by frontends as ascending User # or Player #,
* such as Player 1, Player 2, Player 3, etc. Which device subclasses are
* supported can vary per input port.
*
* The first inner element of each entry in the retro_controller_info array
* is a retro_controller_description struct that specifies the names and
* codes of all device subclasses that are available for the corresponding
* User or Player, beginning with the generic Libretro device that the
* subclasses are derived from. The second inner element of each entry is the
* total number of subclasses that are listed in the retro_controller_description.
*
* NOTE: Even if special device types are set in the libretro core,
* libretro should only poll input based on the base input device types. * libretro should only poll input based on the base input device types.
*/ */
#define RETRO_ENVIRONMENT_SET_MEMORY_MAPS (36 | RETRO_ENVIRONMENT_EXPERIMENTAL) #define RETRO_ENVIRONMENT_SET_MEMORY_MAPS (36 | RETRO_ENVIRONMENT_EXPERIMENTAL)
@ -2337,7 +2350,13 @@ RETRO_API void retro_get_system_av_info(struct retro_system_av_info *info);
* will only poll input based on that particular device type. It is only a * will only poll input based on that particular device type. It is only a
* hint to the libretro core when a core cannot automatically detect the * hint to the libretro core when a core cannot automatically detect the
* appropriate input device type on its own. It is also relevant when a * appropriate input device type on its own. It is also relevant when a
* core can change its behavior depending on device type. */ * core can change its behavior depending on device type.
*
* As part of the core's implementation of retro_set_controller_port_device,
* the core should call RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS to notify the
* frontend if the descriptions for any controls have changed as a
* result of changing the device type.
*/
RETRO_API void retro_set_controller_port_device(unsigned port, unsigned device); RETRO_API void retro_set_controller_port_device(unsigned port, unsigned device);
/* Resets the current game. */ /* Resets the current game. */