ptitSeb/gl4es

arb functions question

kas1e opened this issue · 5 comments

kas1e commented

I probabaly do something wrong, but should't this test case build and links ? :

#define GL_GLEXT_PROTOTYPES 

#include <GL/gl.h>
#include <GL/glext.h>

GLuint m_pos_fbo;

int main()
{
	glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_pos_fbo);
}

It compiles fine, but when i want to link it with gl4es, it just say me that "glBinBufferARB" is undefined reference. Maybe i miss something there , or maybe for amigaos4 those functions disabled in gl4es ?

No, that will probably not link as you define prototype function for ALL gl extensions function... many that will not be in libGL

kas1e commented

With removed #define GL_GLEXT_PROTOTYPES have same error on linking .. I search in gl4es sources and can see gl/buffers.c that part of code:

//ARB wrapper
#ifndef AMIGAOS4
AliasExport(void,glGenBuffers,ARB,(GLsizei n, GLuint * buffers));
AliasExport(void,glBindBuffer,ARB,(GLenum target, GLuint buffer));
AliasExport(void,glBufferData,ARB,(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage));
AliasExport(void,glBufferSubData,ARB,(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data));
AliasExport(void,glDeleteBuffers,ARB,(GLsizei n, const GLuint * buffers));
AliasExport(GLboolean,glIsBuffer,ARB,(GLuint buffer));
AliasExport(void,glGetBufferParameteriv,ARB,(GLenum target, GLenum value, GLint * data));
AliasExport(void*,glMapBuffer,ARB,(GLenum target, GLenum access));
AliasExport(GLboolean,glUnmapBuffer,ARB,(GLenum target));
AliasExport(void,glGetBufferSubData,ARB,(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data));
AliasExport(void,glGetBufferPointerv,ARB,(GLenum target, GLenum pname, GLvoid ** params));
#endif

I assume that the part which make those function not link guilty for ? This amigaos4 ifndef i mean

kas1e commented

So.. once i undef those functions , i can link it with #define GL_GLEXT_PROTOTYPES . Strange why we have this ifndef there at all..

look here #143

kas1e commented

Rigth, aglGetProcAddress(...) then :) Thanks!