How to create a fictitious / false OpenGL context with SDL 2.0 on Windows

As an aspiring game developer here, I am currently involved in C ++ and OpenGL graphics, and the desire is to put together a skeleton project that I can use for small game projects, and also share with some friends with the same interest.

The goal is OpenGL 3.3+ (without using obsolete mechanisms such as "glBegin", etc.), using the SDL 2.0, GLEW 1.10.0 (with WGLEW) and GLM 0.9.4.5 libraries. I am developing Visual Studio 2012 and, first of all, for Windows, but, if possible, compatibility with several platforms is also possible.

The problem is that I'm trying to implement Anti- Aliasing right now. Most sources seem to tell me that in order to achieve this, I first need to create a dummy context in order to access some OpenGL functions, activate multisampling, and finally create the correct rendering context. As described on the [OpenGLs] pages ( http://www.opengl.org/wiki/Creating_an_OpenGL_Context_%28WGL%29 "Creating an OpenGL Context").

What I am thinking about is; Most manuals, examples, etc. They tend to either mix SDL functionality and OpenGL calls, or build functions with full focus on OpenGL calls. Although I could reproduce this with some kind of digital elbow lubrication; half the reason I want to use SDL is that I don’t need to control window handles, pixel formats, and so much, but let SDL take care of that.

So I ask you now; Can I somehow create a dummy context, initiate things like multisampling and anisotropy, and transfer them to the proper context exclusively through support libraries such as SDL 2.0, or will I need to get my hands on the OpenGL API (preferably through GLEW ) and build some startup features like others? If I need, I would not lose a significant part of the SDL goal?

+4
source share

Source: https://habr.com/ru/post/1501566/


All Articles