aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-06-16 20:25:50 +0200
committerRay <raysan5@gmail.com>2016-06-16 20:25:50 +0200
commit4df7a0f2f8cf5c4dde236bd99d05d83c7b472db5 (patch)
treee6c561533268010b868e7fa2d1e367d8f2e94bcb /src/core.c
parent3468af213f88cd367eac43826ad49f9e9fc730f4 (diff)
downloadraylib-4df7a0f2f8cf5c4dde236bd99d05d83c7b472db5.tar.gz
raylib-4df7a0f2f8cf5c4dde236bd99d05d83c7b472db5.zip
Added support for OpenGL 2.1
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core.c b/src/core.c
index fb71af21..7c2dbcb9 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1480,16 +1480,21 @@ static void InitDisplay(int width, int height)
// NOTE: When asking for an OpenGL context version, most drivers provide highest supported version
// with forward compatibility to older OpenGL versions.
// For example, if using OpenGL 1.1, driver can provide a 3.3 context fordward compatible.
-
- // Check selection OpenGL version (not initialized yet!)
- if (rlGetVersion() == OPENGL_33)
+
+ if (configFlags & FLAG_MSAA_4X_HINT)
{
- if (configFlags & FLAG_MSAA_4X_HINT)
- {
- glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0
- TraceLog(INFO, "Trying to enable MSAA x4");
- }
+ glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0
+ TraceLog(INFO, "Trying to enable MSAA x4");
+ }
+ // Check selection OpenGL version
+ if (rlGetVersion() == OPENGL_21)
+ {
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); // Choose OpenGL major version (just hint)
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); // Choose OpenGL minor version (just hint)
+ }
+ else if (rlGetVersion() == OPENGL_33)
+ {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // Choose OpenGL major version (just hint)
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint)
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above!