Hello,
I tried to use GLESv2 with SDL2. It works (a little) with my integrated
intel chipset, but not at all (segfault) with my Nvidia Geforce460.
I’m using ArchLinux as OS, with proprietary nvidia drivers (the latest,
or perhaps two months old).
So i tried to use GLESv2 the ?SDL2 way? and look in the SDL2 test
directory to see how it was done.
I’ve understood that every OpenGL functions need to be re-declared.
So i tried, and now it segfault everywhere!
#include <SDL2/SDL.h>
#include<SDL2/SDL_opengles2.h>
typedef struct GLES2_Context
{
#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
// SDL_gles2funcs.h is stolen from SDL2 sources
// it is NOT installed in /usr/include/SDL2 by default.
#include “SDL_gles2funcs.h”
#undef SDL_PROC
} GLES2_Context;
GLES2_Context ctx; //ne pas confondre avec SDL_GLContext
If i look ctx with gdb, the coredump is easy to understand:
(gdb) print ctx
$1 = {glActiveTexture = 0x0, glAttachShader = 0x0, glBindAttribLocation
= 0x0, glBindTexture = 0x0, glBlendFuncSeparate = 0x0, glClear = 0x0,
glClearColor = 0x0, glCompileShader = 0x0, glCreateProgram = 0x0,
glCreateShader = 0x0, ? (like this to the end of the struct.)
Can you help me, please ?
Thank youk.