Anonymous avatar Anonymous committed 2db9a2e

Comments (0)

Files changed (1)

+= Simple Usage =
+\\
+
+=== Linking ===
+* Copy the glxx.h & glxx.cpp files directly inside your project
+(add them to precompiled header for faster compilations)
+* Create a static lib project and add the sources & headers, then link to the compiled library.
+* With Qt Creator, use the glxx.pro to compile a static library, then include(glxx.pri) to your my_project.pro file.
+\\
+\\
+
+== Core Contexts ==
+{{{
+#!cpp
+#include "glxx.h"
+using namespace glxx::gl_version_3_3; // This will bring all core functions up to 3.3
+// ...
+
+on_OpenGL_init()
+{
+    if (!glxx::has_version_3_3()) {
+        std::cerr << "Current context does not support OpenGL Core 3.3";
+        exit(0);
+    }
+    if (!glxx::load_version_3_3()) {
+        std::cerr << "Could not load all core 3.3 functions";
+    }
+}
+// ...
+on_OpenGL_paint()
+{   
+    glClear(GL_COLOR_BUFFER_BIT);
+    // glWhateverCommand(...) up to 3.3 (core only)
+}
+}}}
+\\
+\\
+
+== Compatibility contexts ==
+{{{
+#!cpp
+#include <glxx.h> // glxx.h is in the inluce path.
+using namespace glxx::version_3_1_deprecated; // This brings in all (compatibility + core) OpenGL functions up to 3.1
+// ...
+
+on_OpenGL_init()
+{
+    if (!glxx::has_version_3_1_deprecated()) {
+        // Current context does not support version 3.1
+    }
+    if (!glxx::load_version_3_1_deprecated()) {
+        // Could not load all version 3.1 functions
+    }
+}
+
+on_OpenGL_paint()
+{
+    glClear(GL_COLOR_BUFFER_BIT);
+    glMatrixMode(GL_PROJECTION);
+    // glWhateverFunction(...); up to OpenGL 3.1
+}
+
+}}}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.