blob: 882c5ea2e347c16236dbc1a7cb2331438384364f [file] [log] [blame]
/* NOTE: Do not edit this file, it is generated by a script:
Export.py --api gl 4.4 --api wgl 4.4 --api glx 4.4 --api cgl 1.4 --api egl 1.0 --outdir .
*/
/*
Copyright (c) 2011-2013 NVIDIA Corporation
Copyright (c) 2011-2013 Cass Everitt
Copyright (c) 2012-2013 Scott Nations
Copyright (c) 2012 Mathias Schott
Copyright (c) 2012-2013 Nigel Stewart
Copyright (c) 2012-2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Intended formatting conventions:
$ astyle --style=allman --indent=spaces=2 --indent-switches
*/
#include "RegalUtil.h"
#if REGAL_EMULATION
REGAL_GLOBAL_BEGIN
#include "RegalPrivate.h"
#include "RegalContext.h"
#include "RegalDispatch.h"
#include "RegalObj.h"
#include "RegalEmuProcsObj.h"
REGAL_GLOBAL_END
REGAL_NAMESPACE_BEGIN
static void REGAL_CALL emuProcInterceptObj_glBindBuffer(RegalContext *_context, GLenum target, GLuint buffer)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->BindBuffer(*_context, target, buffer); return;
orig.glBindBuffer( _context, target, buffer );
}
static void REGAL_CALL emuProcInterceptObj_glBindBufferARB(RegalContext *_context, GLenum target, GLuint buffer)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->BindBuffer(*_context, target, buffer); return;
orig.glBindBufferARB( _context, target, buffer );
}
static void REGAL_CALL emuProcInterceptObj_glBindTexture(RegalContext *_context, GLenum target, GLuint texture)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->BindTexture(*_context, target, texture); return;
orig.glBindTexture( _context, target, texture );
}
static void REGAL_CALL emuProcInterceptObj_glBindVertexArray(RegalContext *_context, GLuint array)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->BindVertexArray(*_context, array); return;
orig.glBindVertexArray( _context, array );
}
static void REGAL_CALL emuProcInterceptObj_glDeleteBuffers(RegalContext *_context, GLsizei n, const GLuint *buffers)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->DeleteBuffers(*_context, n, buffers); return;
orig.glDeleteBuffers( _context, n, buffers );
}
static void REGAL_CALL emuProcInterceptObj_glDeleteBuffersARB(RegalContext *_context, GLsizei n, const GLuint *buffers)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->DeleteBuffers(*_context, n, buffers); return;
orig.glDeleteBuffersARB( _context, n, buffers );
}
static void REGAL_CALL emuProcInterceptObj_glDeleteTextures(RegalContext *_context, GLsizei n, const GLuint *textures)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->DeleteTextures(*_context, n, textures); return;
orig.glDeleteTextures( _context, n, textures );
}
static void REGAL_CALL emuProcInterceptObj_glDeleteVertexArrays(RegalContext *_context, GLsizei n, const GLuint *arrays)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->DeleteVertexArrays(*_context, n, arrays); return;
orig.glDeleteVertexArrays( _context, n, arrays );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture1D(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture1D( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level); return;
orig.glFramebufferTexture1D( _context, target, attachment, textarget, texture, level );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture1DEXT(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture1DEXT( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level); return;
orig.glFramebufferTexture1DEXT( _context, target, attachment, textarget, texture, level );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture2D(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture2D( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level); return;
orig.glFramebufferTexture2D( _context, target, attachment, textarget, texture, level );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture2DEXT(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture2DEXT( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level); return;
orig.glFramebufferTexture2DEXT( _context, target, attachment, textarget, texture, level );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture2DMultisampleEXT(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture2DMultisampleEXT( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level, samples); return;
orig.glFramebufferTexture2DMultisampleEXT( _context, target, attachment, textarget, texture, level, samples );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture2DOES(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture2DOES( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level); return;
orig.glFramebufferTexture2DOES( _context, target, attachment, textarget, texture, level );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture3DEXT(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture3DEXT( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level, zoffset); return;
orig.glFramebufferTexture3DEXT( _context, target, attachment, textarget, texture, level, zoffset );
}
static void REGAL_CALL emuProcInterceptObj_glFramebufferTexture3DOES(RegalContext *_context, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glFramebufferTexture3DOES( _context,target, attachment, textarget, _context->obj->textureNames.ToDriverName(texture), level, zoffset); return;
orig.glFramebufferTexture3DOES( _context, target, attachment, textarget, texture, level, zoffset );
}
static void REGAL_CALL emuProcInterceptObj_glGenBuffers(RegalContext *_context, GLsizei n, GLuint *buffers)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->GenBuffers(*_context, n, buffers); return;
orig.glGenBuffers( _context, n, buffers );
}
static void REGAL_CALL emuProcInterceptObj_glGenBuffersARB(RegalContext *_context, GLsizei n, GLuint *buffers)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->GenBuffers(*_context, n, buffers); return;
orig.glGenBuffersARB( _context, n, buffers );
}
static void REGAL_CALL emuProcInterceptObj_glGenTextures(RegalContext *_context, GLsizei n, GLuint *textures)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->GenTextures(*_context, n, textures); return;
orig.glGenTextures( _context, n, textures );
}
static void REGAL_CALL emuProcInterceptObj_glGenVertexArrays(RegalContext *_context, GLsizei n, GLuint *arrays)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
_context->obj->GenVertexArrays(*_context, n, arrays); return;
orig.glGenVertexArrays( _context, n, arrays );
}
static void REGAL_CALL emuProcInterceptObj_glGetFramebufferAttachmentParameteriv(RegalContext *_context, GLenum target, GLenum attachment, GLenum pname, GLint *params)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glGetFramebufferAttachmentParameteriv( _context,target, attachment, pname, params);
if (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)
{
GLint attachType = GL_RENDERBUFFER;
orig.glGetFramebufferAttachmentParameteriv( _context,target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &attachType);
if (attachType == GL_TEXTURE)
*params = _context->obj->textureNames.ToAppName(*params);
}
return;
orig.glGetFramebufferAttachmentParameteriv( _context, target, attachment, pname, params );
}
static void REGAL_CALL emuProcInterceptObj_glGetFramebufferAttachmentParameterivEXT(RegalContext *_context, GLenum target, GLenum attachment, GLenum pname, GLint *params)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
orig.glGetFramebufferAttachmentParameterivEXT( _context,target, attachment, pname, params);
if (pname == GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)
{
GLint attachType = GL_RENDERBUFFER;
orig.glGetFramebufferAttachmentParameterivEXT( _context,target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &attachType);
if (attachType == GL_TEXTURE)
*params = _context->obj->textureNames.ToAppName(*params);
}
return;
orig.glGetFramebufferAttachmentParameterivEXT( _context, target, attachment, pname, params );
}
static GLboolean REGAL_CALL emuProcInterceptObj_glIsBuffer(RegalContext *_context, GLuint buffer)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
return _context->obj->IsBuffer(*_context, buffer);
return orig.glIsBuffer( _context, buffer );
}
static GLboolean REGAL_CALL emuProcInterceptObj_glIsBufferARB(RegalContext *_context, GLuint buffer)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
return _context->obj->IsBuffer(*_context, buffer);
return orig.glIsBufferARB( _context, buffer );
}
static GLboolean REGAL_CALL emuProcInterceptObj_glIsTexture(RegalContext *_context, GLuint texture)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
return _context->obj->IsTexture(*_context, texture);
return orig.glIsTexture( _context, texture );
}
static GLboolean REGAL_CALL emuProcInterceptObj_glIsVertexArray(RegalContext *_context, GLuint array)
{
RegalAssert(_context);
EmuProcsOriginateObj & orig = _context->obj->orig;
// impl
return _context->obj->IsVertexArray(*_context, array);
return orig.glIsVertexArray( _context, array );
}
void EmuProcsInterceptObj( Dispatch::GL & dt ) {
dt.glBindBuffer = emuProcInterceptObj_glBindBuffer;
dt.glBindBufferARB = emuProcInterceptObj_glBindBufferARB;
dt.glBindTexture = emuProcInterceptObj_glBindTexture;
dt.glBindVertexArray = emuProcInterceptObj_glBindVertexArray;
dt.glDeleteBuffers = emuProcInterceptObj_glDeleteBuffers;
dt.glDeleteBuffersARB = emuProcInterceptObj_glDeleteBuffersARB;
dt.glDeleteTextures = emuProcInterceptObj_glDeleteTextures;
dt.glDeleteVertexArrays = emuProcInterceptObj_glDeleteVertexArrays;
dt.glFramebufferTexture1D = emuProcInterceptObj_glFramebufferTexture1D;
dt.glFramebufferTexture1DEXT = emuProcInterceptObj_glFramebufferTexture1DEXT;
dt.glFramebufferTexture2D = emuProcInterceptObj_glFramebufferTexture2D;
dt.glFramebufferTexture2DEXT = emuProcInterceptObj_glFramebufferTexture2DEXT;
dt.glFramebufferTexture2DMultisampleEXT = emuProcInterceptObj_glFramebufferTexture2DMultisampleEXT;
dt.glFramebufferTexture2DOES = emuProcInterceptObj_glFramebufferTexture2DOES;
dt.glFramebufferTexture3DEXT = emuProcInterceptObj_glFramebufferTexture3DEXT;
dt.glFramebufferTexture3DOES = emuProcInterceptObj_glFramebufferTexture3DOES;
dt.glGenBuffers = emuProcInterceptObj_glGenBuffers;
dt.glGenBuffersARB = emuProcInterceptObj_glGenBuffersARB;
dt.glGenTextures = emuProcInterceptObj_glGenTextures;
dt.glGenVertexArrays = emuProcInterceptObj_glGenVertexArrays;
dt.glGetFramebufferAttachmentParameteriv = emuProcInterceptObj_glGetFramebufferAttachmentParameteriv;
dt.glGetFramebufferAttachmentParameterivEXT = emuProcInterceptObj_glGetFramebufferAttachmentParameterivEXT;
dt.glIsBuffer = emuProcInterceptObj_glIsBuffer;
dt.glIsBufferARB = emuProcInterceptObj_glIsBufferARB;
dt.glIsTexture = emuProcInterceptObj_glIsTexture;
dt.glIsVertexArray = emuProcInterceptObj_glIsVertexArray;
}
REGAL_NAMESPACE_END
#endif // REGAL_EMULATION