-
Notifications
You must be signed in to change notification settings - Fork 59
Examples
Daniel Limberger edited this page Nov 17, 2016
·
21 revisions
Note: this requires OPTION_BUILD_EXAMPLES=On
.
Brief overview of the following globjects examples:
- commandlineoutput
- computeshader
- programpipelines
- qt-example
- shaderincludes
- sparse-texture
- states
- tessellation
- texture
- transformfeedback
- wikiexample
commandlineoutput shows the logging capabilities of globjects. The output is:
OpenGL Version: 3.1
OpenGL Vendor: NVIDIA Corporation
OpenGL Renderer: GeForce GTX 960M/PCIe/SSE2
Test Logging of Standard Types:
void * 00000013E0B5EDE8 : 00000013E0B5EDE8
bool true : true
char 'a' : a
unsigned char 'a' : a
const char * "hello" : hello
const std::string & "world" : world
short 32767 : 32767
int 2147483647 : 2147483647
unsigned integer 23 : 23
long integer 1337 : 1337
long long integer 1234567890 : 1234567890
unsigned long integer 45123 : 45123
float 3.14159 : 3.14159
double 3.141592654 : 3.141592654
long double 2.71828 : 2.71828
Test Logging of Container Types:
std::array<int, 2> : array(0, 1)
std::vector<float> : vector(0.1, 0.2, 0.3)
Test Logging of globjects objects:
Buffer : Buffer(1)
Framebuffer : FrameBufferObject(0)
Program : Program(1)
Query : Query(1)
Renderbuffer : RenderBufferObject(1)
Sampler : Sampler(1)
Shader : Shader(2)
Texture : Texture(1)
TransformFeedback : TransformFeedback(1)
VertexArray : VertexArrayObject(1)
Uniform : Uniform(Pi, 3.14)
AbstractUniform : AbstractUniform(Pi)
glbinding::Version : Version 3.1
std::vector<Buffer *> : vector(Buffer(2), Buffer(3))
computeshader shows how compute shader can be loaded and used with globjects. The output is:
programpipelines shows how program pipelines can be configured and used with globjects. The output is:
qtexample shows how the Qt framework can be used in conjunction with globjects for rendering within a QWindow
. Note: OpenGLWindow
was introduced in Qt 5.4. The example can be easily adjusted following the instructions on http://doc.qt.io/.