The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
OpenGL ES 3.0 on Desktop
devqq


Joined: 30 Oct 2016
Posts: 5
Hi everyone,

I am trying to understand how to work with GLES 3.0 on Windows 7.
From what I understand SDL2 supports this and Nvidia desktop driver for my card (1080 gtx) also supports this.
However I am slightly confused with what tools I exactly need for this.

Do I need GLEW? Special settings for GLEW?
Do I need Khronos headers? gl3platform.h gl2ext.h gl3.h khrplatform.h
Is there a particular order of initialization? Right now I have, CreateWindow, InitGlew, CreateContext in that order.
I am aware there is SDL flags to set, I set each attribute and hint manually, for example SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES)

Right now my create window fails with "Could not initialize OpenGL / Gles library".

Anyone done this before? I would really appreciate some guidance,

Thanks.
devqq


Joined: 30 Oct 2016
Posts: 5
No one done this before? I am kinda stuck here without making any progress Sad
MZIskandar


Joined: 10 Aug 2016
Posts: 4
Hello.
Why do you want to use OpenGL ES for desktop?
OpenGL ES (embedded system) are made for mobile.

GLEW is GL Extension Wrangler. It helps you to setup the "Extensions", which I don't use.

To use OpenGL include:
#include <SDL2/SDL_opengl.h>

To use extension add (tedious without GLEW but you will really know wjat to use :
eg: static PFNGLGENBUFFERSPROC glGenBuffers;, and so on..
later in main, eg: glGenBuffers = SDL_GL_GetProcAddress("glGenBuffers");

Creating OpenGL window:
SDL_Window* myWindow = NULL;
myWindow = SDL_CreateWindow("Window Title", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL);

Lots of other example in SDL2-2.0.5\test directory (which I overlook when I started learning SDL)
http://libsdl.org/release/SDL2-2.0.5.zip
devqq


Joined: 30 Oct 2016
Posts: 5
Thanks for the reply, the reason I want to use it is because I already have some code that ran on iOS before that uses GLES 3.0.
So I prefer to try and make an ES context as opposed to using desktop version and having some #ifdefs or something.
MZIskandar


Joined: 10 Aug 2016
Posts: 4
I haven't done any IOS/Andoid using SDL.
You can try compiling "testgles2.c" for IOS from the example.
rtrussell


Joined: 10 Feb 2016
Posts: 88
devqq wrote:
Thanks for the reply, the reason I want to use it is because I already have some code that ran on iOS before that uses GLES 3.0.
So I prefer to try and make an ES context as opposed to using desktop version and having some #ifdefs or something.

Do you know for sure that the GL calls you make are ES-specific? In my app (which runs on both desktop with OpenGL and on Android with GLES 1.0) I am only making calls that I know are compatible with both: specifically simple things like glEnable, glLogicOp and glDisable. I guess I'm lucky that the few calls I need are available in both contexts, but perhaps you will be too.

Richard.
devqq


Joined: 30 Oct 2016
Posts: 5
rtrussell wrote:
devqq wrote:
Thanks for the reply, the reason I want to use it is because I already have some code that ran on iOS before that uses GLES 3.0.
So I prefer to try and make an ES context as opposed to using desktop version and having some #ifdefs or something.

Do you know for sure that the GL calls you make are ES-specific? In my app (which runs on both desktop with OpenGL and on Android with GLES 1.0) I am only making calls that I know are compatible with both: specifically simple things like glEnable, glLogicOp and glDisable. I guess I'm lucky that the few calls I need are available in both contexts, but perhaps you will be too.

Richard.


Yes I am sure because I helped write the code, it is fully core ES 3.0
At this point I am considering if I should use the Angle drivers?
devqq


Joined: 30 Oct 2016
Posts: 5
Maybe Sam Lantinga knows what to do but I can't pm him for some reason Sad