Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
> On May 26, 2017, at 11:56 AM, nore...@z505.com wrote: > > All these calls look kind of tedious, instead of using a wrapper. But maybe > you want to learn opengl at its heart and not use a wrapper.. and learn all > the fine details the hard way (full respect for that). Imo I think it pays

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
> On May 25, 2017, at 7:02 PM, Anthony Walter wrote: > > Ryan, > > Are you loading the OpenGL API functions using SDL_GL_GetProcAddress? You > really should be doing that or you're asking for problems. > > Anyways, if you want maximum capability you should probably use ES

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread noreply
On 2017-05-23 22:13, Ryan Joseph wrote: I’ve wasted so much time on this I just need to stop and ask for help already. Over the last few years I’ve been picking away at OpenGL and only ever got the legacy 2.x API to work which has been fine for making 2D games but I wanted to at least learn the

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Marco van de Voort
In our previous episode, Anthony Walter said: > And if you're not using GLSL shaders, then you don't need anything greater > than Open 1.5. You can see the list of changes at the link below. With the > exception of frame buffer objects (better known as render to texture) in > version 3.0 and up,

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Anthony Walter
Ryan, Are you loading the OpenGL API functions using SDL_GL_GetProcAddress? You really should be doing that or you're asking for problems. Anyways, if you want maximum capability you should probably use ES version 2, as it's supported on the most devices. It requires you to drop the fixed

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
> On May 25, 2017, at 2:30 PM, Anthony Walter wrote: > > You need to tell SDL what OpenGL kind and version before you create a window. > For example if you want OpenGLES 2.0 you would write: > > SDL_Init(SDL_INIT_VIDEO); >

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Anthony Walter
Oh and another note, you cannot load your gl function such as (glClear in my previous reply, this time I use glGenTextures): var glGenTextures: procedure(n: GLsizei; var textures: GLuint); cdecl; Until you create and make current your OpenGL context. SDL_GL_MakeCurrent(window, context); // after

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Anthony Walter
You need to tell SDL what OpenGL kind and version before you create a window. For example if you want OpenGLES 2.0 you would write: SDL_Init(SDL_INIT_VIDEO); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-24 Thread Ryan Joseph
> On May 24, 2017, at 7:18 PM, Graeme Geldenhuys > wrote: > >> Any ideas on what’s wrong with this? > Ok, I got an answer from a person on YouTube and figured this out. The problem was 1) that SDL is returning a different version then I asked for and I didn’t

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-24 Thread Graeme Geldenhuys
On 2017-05-24 04:13, Ryan Joseph wrote: Any ideas on what’s wrong with this? I actually used the Java + OpenGL tutorials on YouTube, and translating those examples to Object Pascal + OpenGL + SDL2 was pretty easy. This is my favourite one, and uses "modern OpenGL" only.

[fpc-pascal] OpenGL and SDL frustrations

2017-05-23 Thread Ryan Joseph
I’ve wasted so much time on this I just need to stop and ask for help already. Over the last few years I’ve been picking away at OpenGL and only ever got the legacy 2.x API to work which has been fine for making 2D games but I wanted to at least learn the modern API and shaders. Here’s a