CGVIS Utils
Loading...
Searching...
No Matches
GLApp.h File Reference

Minimal application framework for running OpenGL or WebGL demos. More...

#include <string>
#include "GLEnv.h"
#include "GLProgram.h"
#include "GLArray.h"
#include "GLBuffer.h"
#include "GLTexture2D.h"
#include "Image.h"
#include "GLAppKeyTranslation.h"
Include dependency graph for GLApp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GLApp
 Simple app runner with a GL context, stock shaders, and draw helpers. More...

Enumerations

enum class  LineDrawType { LIST , STRIP , LOOP }
 Line primitive topology for drawLines(). More...
enum class  TrisDrawType { LIST , STRIP , FAN }
 Triangle primitive topology for drawTriangles(). More...

Detailed Description

Minimal application framework for running OpenGL or WebGL demos.

Provides a small, cross‑platform wrapper around GLEnv (GLFW+GLEW on desktop, Emscripten on the web) and a set of convenience methods to draw points, lines and textured quads, as well as to manage a few built‑in shader programs. Subclass GLApp and override init(), draw(), animate(), and input callbacks to build an interactive sketch.

The class also exposes helpers to compute pixel‑correct transforms for images and to upload point‑sprite textures used by drawPoints().

Enumeration Type Documentation

◆ LineDrawType

enum class LineDrawType
strong

Line primitive topology for drawLines().

Enumerator
LIST 

Disconnected line segments (GL_LINES)

STRIP 

Connected polyline (GL_LINE_STRIP)

LOOP 

Closed polyline (GL_LINE_LOOP)

◆ TrisDrawType

enum class TrisDrawType
strong

Triangle primitive topology for drawTriangles().

Enumerator
LIST 

Independent triangles (GL_TRIANGLES)

STRIP 

Triangle strip (GL_TRIANGLE_STRIP)

FAN 

Triangle fan (GL_TRIANGLE_FAN)