SimpleGL  1.1.0
A framework for platform independent rendering
Classes | Enumerations | Functions | Variables
sgl Namespace Reference

Generic namespace for the SimpleGL framework. More...

Classes

class  Application
 This is the base class for an application. More...
 
class  ApplicationGL
 This class should get extended by the user when using the OpenGL backend. More...
 
class  ApplicationVK
 This class should get extended by the user when using the Vulkan backend. More...
 
class  Batch
 This class defines methods for batch rendering. More...
 
class  BatchGL
 This class is used for batch rendering with OpenGL. More...
 
class  BatchVK
 This class is used for batch rendering with Vulkan. More...
 
class  Buffer
 This class wraps an OpenGL buffer object. More...
 
struct  Camera
 This struct defines a camera. More...
 
class  CommandBuffer
 This class wraps a Vulkan command buffer. More...
 
class  CommandPool
 This class wraps a Vulkan command pool. More...
 
class  DebugReportCallback
 This class wraps a Vulkan debug report callback. More...
 
struct  DepthStencilBuffer
 This struct stores the data of a depth stencil buffer. More...
 
class  DescriptorPool
 This class wraps a Vulkan descriptor pool. More...
 
class  DescriptorSet
 This class wraps a Vulkan descriptor set. More...
 
class  Device
 This class wraps a Vulkan logical device. More...
 
class  ErrorCallback
 This class wraps a GLFW error callback. More...
 
class  Event
 This abstract class defines a event for the application. More...
 
class  Fence
 This class wraps a Vulkan fence. More...
 
class  FramebufferGL
 This class wraps an OpenGL framebuffer object. More...
 
class  FramebufferVK
 This class wraps a Vulkan framebuffer. More...
 
class  GL
 This static class wraps general OpenGL functions. More...
 
class  GLFW
 This static class wraps general GLFW functions. More...
 
struct  GLVersion
 Structure for saving the OpenGL version. More...
 
class  GraphicsPipeline
 This class wraps a Vulkan graphics pipeline. More...
 
class  Instance
 This class wraps a Vulkan instance. More...
 
class  KeyCallback
 This class wraps a GLFW key callback. More...
 
class  KeyEvent
 This class defines a key event, created by the KeyCallback. More...
 
struct  Light
 This structure defines a light. More...
 
class  Logger
 This class is used to log information and errors. More...
 
class  Manager
 This class provides an abstract class for managing objects. More...
 
struct  Material
 This structure defines a material. More...
 
class  Model
 This class contains static methods to calculate model matrices. More...
 
class  MouseButtonCallback
 This class wraps a GLFW mouse button callback. More...
 
class  MouseButtonEvent
 This class defines a mouse button event, created by the MouseButtonCallback. More...
 
class  PhysicalDevice
 This class wraps a Vulkan physical device and represents a graphics card. More...
 
class  Projection
 This class contains static methods to calculate projection matrices. More...
 
struct  QueueFamilyIndices
 This struct stores relevant queue family indices. More...
 
struct  Queues
 This struct stores relevant device queues. More...
 
class  Renderbuffer
 This class wraps an OpenGL renderbuffer object. More...
 
class  RenderPass
 This class wraps a Vulkan render pass. More...
 
class  Semaphore
 This class wraps a Vulkan semaphore. More...
 
class  Shader
 This class wraps an OpenGL shader object. More...
 
class  ShaderManager
 This class provides an class for managing shaders. More...
 
class  ShaderModule
 This class wraps a Vulkan shader module. More...
 
class  ShaderModuleManager
 This class provides methods for managing shader modules. More...
 
class  ShaderProgram
 This class wraps an OpenGL shader program. More...
 
class  Surface
 This class wraps a Vulkan surface. More...
 
class  Swapchain
 This class wraps a Vulkan swapchain. More...
 
struct  SwapchainData
 This struct stores relevant swapchain data. More...
 
struct  SwapchainSupportDetails
 This struct stores necessary data for swapchain support. More...
 
class  Texture
 This class wraps an OpenGL texture object. More...
 
struct  TextureData
 This structure stores texture image data. More...
 
class  TextureImage
 This class wraps a Vulkan texture image. More...
 
class  TextureImageManager
 This class provides methods for managing texture images. More...
 
class  TextureManager
 This class provides an class for managing textures. More...
 
class  TimeUtil
 This class contains static methods for time calculations. More...
 
struct  Transformation
 This struct contains information to calculate the Model-View-Projection-Matrix. More...
 
class  UniformBuffer
 This class wraps a Vulkan uniform buffer. More...
 
class  VertexArray
 This class wraps an OpenGL vertex array object. More...
 
class  VertexBuffer
 This class wraps a Vulkan vertex buffer. More...
 
class  View
 This class contains static methods to calculate view matrices. More...
 
class  VulkanContext
 This class contains all relevant Vulkan objects to setup a Vulkan application. More...
 
class  Window
 This class provides a basic GLFW window. More...
 
class  WindowGL
 This class provides a GLFW window with OpenGL context. More...
 
class  WindowVK
 This class provides a GLFW window with a Vulkan instance. More...
 

Enumerations

enum  EventType { EventType::KEY_EVENT, EventType::MOUSE_BUTTON_EVENT }
 This enum contains different event types. More...
 
enum  Key {
  Key::KEY_UNKNOWN = GLFW_KEY_UNKNOWN, Key::KEY_SPACE = GLFW_KEY_SPACE, Key::KEY_APOSTROPHE = GLFW_KEY_APOSTROPHE, Key::KEY_COMMA = GLFW_KEY_COMMA,
  Key::KEY_MINUS = GLFW_KEY_MINUS, Key::KEY_PERIOD = GLFW_KEY_PERIOD, Key::KEY_SLASH = GLFW_KEY_SLASH, Key::KEY_0 = GLFW_KEY_0,
  Key::KEY_1 = GLFW_KEY_1, Key::KEY_2 = GLFW_KEY_2, Key::KEY_3 = GLFW_KEY_3, Key::KEY_4 = GLFW_KEY_4,
  Key::KEY_5 = GLFW_KEY_5, Key::KEY_6 = GLFW_KEY_6, Key::KEY_7 = GLFW_KEY_7, Key::KEY_8 = GLFW_KEY_8,
  Key::KEY_9 = GLFW_KEY_9, Key::KEY_SEMICOLON = GLFW_KEY_SEMICOLON, Key::KEY_EQUAL = GLFW_KEY_EQUAL, Key::KEY_A = GLFW_KEY_A,
  Key::KEY_B = GLFW_KEY_B, Key::KEY_C = GLFW_KEY_C, Key::KEY_D = GLFW_KEY_D, Key::KEY_E = GLFW_KEY_E,
  Key::KEY_F = GLFW_KEY_F, Key::KEY_G = GLFW_KEY_G, Key::KEY_H = GLFW_KEY_H, Key::KEY_I = GLFW_KEY_I,
  Key::KEY_J = GLFW_KEY_J, Key::KEY_K = GLFW_KEY_K, Key::KEY_L = GLFW_KEY_L, Key::KEY_M = GLFW_KEY_M,
  Key::KEY_N = GLFW_KEY_N, Key::KEY_O = GLFW_KEY_O, Key::KEY_P = GLFW_KEY_P, Key::KEY_Q = GLFW_KEY_Q,
  Key::KEY_R = GLFW_KEY_R, Key::KEY_S = GLFW_KEY_S, Key::KEY_T = GLFW_KEY_T, Key::KEY_U = GLFW_KEY_U,
  Key::KEY_V = GLFW_KEY_V, Key::KEY_W = GLFW_KEY_W, Key::KEY_X = GLFW_KEY_X, Key::KEY_Y = GLFW_KEY_Y,
  Key::KEY_Z = GLFW_KEY_Z, Key::KEY_LEFT_BRACKET = GLFW_KEY_LEFT_BRACKET, Key::KEY_BACKSLASH = GLFW_KEY_BACKSLASH, Key::KEY_RIGHT_BRACKET = GLFW_KEY_RIGHT_BRACKET,
  Key::KEY_GRAVE_ACCENT = GLFW_KEY_GRAVE_ACCENT, Key::KEY_WORLD_1 = GLFW_KEY_WORLD_1, Key::KEY_WORLD_2 = GLFW_KEY_WORLD_2, Key::KEY_ESCAPE = GLFW_KEY_ESCAPE,
  Key::KEY_ENTER = GLFW_KEY_ENTER, Key::KEY_TAB = GLFW_KEY_TAB, Key::KEY_BACKSPACE = GLFW_KEY_BACKSPACE, Key::KEY_INSERT = GLFW_KEY_INSERT,
  Key::KEY_DELETE = GLFW_KEY_DELETE, Key::KEY_RIGHT = GLFW_KEY_RIGHT, Key::KEY_LEFT = GLFW_KEY_LEFT, Key::KEY_DOWN = GLFW_KEY_DOWN,
  Key::KEY_UP = GLFW_KEY_UP, Key::KEY_PAGE_UP = GLFW_KEY_PAGE_UP, Key::KEY_PAGE_DOWN = GLFW_KEY_PAGE_DOWN, Key::KEY_HOME = GLFW_KEY_HOME,
  Key::KEY_END = GLFW_KEY_END, Key::KEY_CAPS_LOCK = GLFW_KEY_CAPS_LOCK, Key::KEY_SCROLL_LOCK = GLFW_KEY_SCROLL_LOCK, Key::KEY_NUM_LOCK = GLFW_KEY_NUM_LOCK,
  Key::KEY_PRINT_SCREEN = GLFW_KEY_PRINT_SCREEN, Key::KEY_PAUSE = GLFW_KEY_PAUSE, Key::KEY_F1 = GLFW_KEY_F1, Key::KEY_F2 = GLFW_KEY_F2,
  Key::KEY_F3 = GLFW_KEY_F3, Key::KEY_F4 = GLFW_KEY_F4, Key::KEY_F5 = GLFW_KEY_F5, Key::KEY_F6 = GLFW_KEY_F6,
  Key::KEY_F7 = GLFW_KEY_F7, Key::KEY_F8 = GLFW_KEY_F8, Key::KEY_F9 = GLFW_KEY_F9, Key::KEY_F10 = GLFW_KEY_F10,
  Key::KEY_F11 = GLFW_KEY_F11, Key::KEY_F12 = GLFW_KEY_F12, Key::KEY_F13 = GLFW_KEY_F13, Key::KEY_F14 = GLFW_KEY_F14,
  Key::KEY_F15 = GLFW_KEY_F15, Key::KEY_F16 = GLFW_KEY_F16, Key::KEY_F17 = GLFW_KEY_F17, Key::KEY_F18 = GLFW_KEY_F18,
  Key::KEY_F19 = GLFW_KEY_F19, Key::KEY_F20 = GLFW_KEY_F20, Key::KEY_F21 = GLFW_KEY_F21, Key::KEY_F22 = GLFW_KEY_F22,
  Key::KEY_F23 = GLFW_KEY_F23, Key::KEY_F24 = GLFW_KEY_F24, Key::KEY_F25 = GLFW_KEY_F25, Key::KEY_KP_0 = GLFW_KEY_KP_0,
  Key::KEY_KP_1 = GLFW_KEY_KP_1, Key::KEY_KP_2 = GLFW_KEY_KP_2, Key::KEY_KP_3 = GLFW_KEY_KP_3, Key::KEY_KP_4 = GLFW_KEY_KP_4,
  Key::KEY_KP_5 = GLFW_KEY_KP_5, Key::KEY_KP_6 = GLFW_KEY_KP_6, Key::KEY_KP_7 = GLFW_KEY_KP_7, Key::KEY_KP_8 = GLFW_KEY_KP_8,
  Key::KEY_KP_9 = GLFW_KEY_KP_9, Key::KEY_KP_DECIMAL = GLFW_KEY_KP_DECIMAL, Key::KEY_KP_DIVIDE = GLFW_KEY_KP_DIVIDE, Key::KEY_KP_MULTIPLY = GLFW_KEY_KP_MULTIPLY,
  Key::KEY_KP_SUBTRACT = GLFW_KEY_KP_SUBTRACT, Key::KEY_KP_ADD = GLFW_KEY_KP_ADD, Key::KEY_KP_ENTER = GLFW_KEY_KP_ENTER, Key::KEY_KP_EQUAL = GLFW_KEY_KP_EQUAL,
  Key::KEY_LEFT_SHIFT = GLFW_KEY_LEFT_SHIFT, Key::KEY_LEFT_CONTROL = GLFW_KEY_LEFT_CONTROL, Key::KEY_LEFT_ALT = GLFW_KEY_LEFT_ALT, Key::KEY_LEFT_SUPER = GLFW_KEY_LEFT_SUPER,
  Key::KEY_RIGHT_SHIFT = GLFW_KEY_RIGHT_SHIFT, Key::KEY_RIGHT_CONTROL = GLFW_KEY_RIGHT_CONTROL, Key::KEY_RIGHT_ALT = GLFW_KEY_RIGHT_ALT, Key::KEY_RIGHT_SUPER = GLFW_KEY_RIGHT_SUPER,
  Key::KEY_MENU = GLFW_KEY_MENU, Key::KEY_LAST = KEY_MENU
}
 This enum wraps the GLFW keys. More...
 
enum  MouseButton {
  MouseButton::MOUSE_BUTTON_1 = GLFW_MOUSE_BUTTON_1, MouseButton::MOUSE_BUTTON_2 = GLFW_MOUSE_BUTTON_2, MouseButton::MOUSE_BUTTON_3 = GLFW_MOUSE_BUTTON_3, MouseButton::MOUSE_BUTTON_4 = GLFW_MOUSE_BUTTON_4,
  MouseButton::MOUSE_BUTTON_5 = GLFW_MOUSE_BUTTON_5, MouseButton::MOUSE_BUTTON_6 = GLFW_MOUSE_BUTTON_6, MouseButton::MOUSE_BUTTON_7 = GLFW_MOUSE_BUTTON_7, MouseButton::MOUSE_BUTTON_8 = GLFW_MOUSE_BUTTON_8,
  MouseButton::MOUSE_BUTTON_LAST = MOUSE_BUTTON_8, MouseButton::MOUSE_BUTTON_LEFT = MOUSE_BUTTON_1, MouseButton::MOUSE_BUTTON_MIDDLE = MOUSE_BUTTON_3, MouseButton::MOUSE_BUTTON_RIGHT = MOUSE_BUTTON_2
}
 This enum wraps the GLFW mouse buttons. More...
 
enum  Action { Action::PRESS = GLFW_PRESS, Action::RELEASE = GLFW_RELEASE, Action::REPEAT = GLFW_REPEAT }
 This enum wraps the GLFW actions. More...
 
enum  Modifier { Modifier::MOD_ALT = GLFW_MOD_ALT, Modifier::MOD_CONTROL = GLFW_MOD_CONTROL, Modifier::MOD_SHIFT = GLFW_MOD_SHIFT, Modifier::MOD_SUPER = GLFW_MOD_SUPER }
 This enum wraps the GLFW modifier bits. More...
 
enum  Capability : GLenum { Capability::BLEND = GL_BLEND, Capability::CULL_FACE = GL_CULL_FACE, Capability::DEPTH_TEST = GL_DEPTH_TEST }
 This enum wraps OpenGL capabilities. More...
 
enum  ClearBit : GLbitfield { ClearBit::COLOR_BUFFER_BIT = GL_COLOR_BUFFER_BIT, ClearBit::DEPTH_BUFFER_BIT = GL_DEPTH_BUFFER_BIT, ClearBit::STENCIL_BUFFER_BIT = GL_STENCIL_BUFFER_BIT }
 This enum wraps the clear buffer bits. More...
 
enum  Primitive : GLenum {
  Primitive::POINTS = GL_POINTS, Primitive::LINES = GL_LINES, Primitive::LINE_STRIP = GL_LINE_STRIP, Primitive::LINE_LOOP = GL_LINE_LOOP,
  Primitive::TRIANGLES = GL_TRIANGLES, Primitive::TRIANGLE_STRIP = GL_TRIANGLE_STRIP, Primitive::TRIANGLE_FAN = GL_TRIANGLE_FAN
}
 This enum wraps Primitive types of OpenGL. More...
 
enum  BlendFactor : GLenum {
  BlendFactor::ZERO = GL_ZERO, BlendFactor::ONE = GL_ONE, BlendFactor::SRC_COLOR = GL_SRC_COLOR, BlendFactor::ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
  BlendFactor::DST_COLOR = GL_DST_COLOR, BlendFactor::ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR, BlendFactor::SRC_ALPHA = GL_SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
  BlendFactor::DST_ALPHA = GL_DST_ALPHA, BlendFactor::ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA, BlendFactor::CONSTANT_COLOR = GL_CONSTANT_COLOR, BlendFactor::ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR,
  BlendFactor::CONSTANT_ALPHA = GL_CONSTANT_ALPHA, BlendFactor::ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA, BlendFactor::SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE, BlendFactor::SRC1_COLOR = GL_SRC1_COLOR,
  BlendFactor::ONE_MINUS_SRC1_COLOR = GL_ONE_MINUS_SRC1_COLOR, BlendFactor::SRC1_ALPHA = GL_SRC1_ALPHA, BlendFactor::ONE_MINUS_SRC1_ALPHA = GL_ONE_MINUS_SRC1_ALPHA
}
 This enum wraps the blend factos. More...
 
enum  CullFaceMode : GLenum { CullFaceMode::FRONT = GL_FRONT, CullFaceMode::BACK = GL_BACK, CullFaceMode::FRONT_AND_BACK = GL_FRONT_AND_BACK }
 This enum wraps the face culling modes. More...
 
enum  DepthFunction : GLenum {
  DepthFunction::NEVER = GL_NEVER, DepthFunction::LESS = GL_LESS, DepthFunction::EQUAL = GL_EQUAL, DepthFunction::LEQUAL = GL_LEQUAL,
  DepthFunction::GREATER = GL_GREATER, DepthFunction::NOTEQUAL = GL_NOTEQUAL, DepthFunction::GEQUAL = GL_GEQUAL, DepthFunction::ALWAYS = GL_ALWAYS
}
 This enum wraps the depth functions. More...
 
enum  ShaderType : GLenum { ShaderType::VERTEX_SHADER = GL_VERTEX_SHADER, ShaderType::FRAGMENT_SHADER = GL_FRAGMENT_SHADER }
 This enum wraps the shader types. More...
 
enum  TextureFilter : GLint { TextureFilter::NEAREST = GL_NEAREST, TextureFilter::LINEAR = GL_LINEAR }
 This enum wraps the texture object's filter. More...
 
enum  TextureWrap : GLint { TextureWrap::CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE, TextureWrap::CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER, TextureWrap::REPEAT = GL_REPEAT, TextureWrap::MIRRORED_REPEAT = GL_MIRRORED_REPEAT }
 This enum wraps the texture object's wrapping functions. More...
 
enum  ValueType : GLenum {
  ValueType::BYTE = GL_BYTE, ValueType::UNSIGNED_BYTE = GL_UNSIGNED_BYTE, ValueType::SHORT = GL_SHORT, ValueType::UNSIGNED_SHORT = GL_UNSIGNED_SHORT,
  ValueType::INT = GL_INT, ValueType::UNSIGNED_INT = GL_UNSIGNED_INT, ValueType::FLOAT = GL_FLOAT, ValueType::DOUBLE = GL_DOUBLE
}
 This enum wraps the vertex array object's value types. More...
 
enum  BufferTarget : GLenum { BufferTarget::ARRAY_BUFFER = GL_ARRAY_BUFFER, BufferTarget::ELEMENT_ARRAY_BUFFER = GL_ELEMENT_ARRAY_BUFFER }
 This enum wraps the buffer object's targets. More...
 
enum  BufferUsage : GLenum {
  BufferUsage::STATIC_DRAW = GL_STATIC_DRAW, BufferUsage::STATIC_READ = GL_STATIC_READ, BufferUsage::STATIC_COPY = GL_STATIC_COPY, BufferUsage::DYNAMIC_DRAW = GL_DYNAMIC_DRAW,
  BufferUsage::DYNAMIC_READ = GL_DYNAMIC_READ, BufferUsage::DYNAMIC_COPY = GL_DYNAMIC_COPY, BufferUsage::STREAM_DRAW = GL_STREAM_DRAW, BufferUsage::STREAM_READ = GL_STREAM_READ,
  BufferUsage::STREAM_COPY = GL_STREAM_COPY
}
 This enum wraps the buffer object's usages. More...
 
enum  MapAccess : GLenum { MapAccess::READ_ONLY = GL_READ_ONLY, MapAccess::WRITE_ONLY = GL_WRITE_ONLY, MapAccess::READ_WRITE = GL_READ_WRITE }
 This enum wraps the buffer object's map accesses. More...
 
enum  MapRangeAccess : GLbitfield { MapRangeAccess::MAP_READ_BIT = GL_MAP_READ_BIT, MapRangeAccess::MAP_WRITE_BIT = GL_MAP_WRITE_BIT }
 This enum wraps the buffer object's map range access bits. More...
 
enum  ShaderStageBit { ShaderStageBit::VERTEX_BIT, ShaderStageBit::FRAGMENT_BIT }
 This enum stores supported shader stage flag bit. More...
 

Functions

SIMPLEGL_EXPORT void init ()
 Initializes SimpleGL and should be called before anything else. More...
 
Modifier operator| (Modifier left, Modifier right)
 Overloaded OR operator for the modifier bit. More...
 
SIMPLEGL_GL_EXPORT void initGL ()
 Initializes the OpenGL backend, this will also check available extensions and should be called after sgl::init(). More...
 
template<typename E >
GLint to_GLint (E e)
 Gets the GLint value from an enum class. More...
 
template<typename E >
GLenum to_GLenum (E e)
 Gets the GLenum value from an enum class. More...
 
template<typename E >
GLbitfield to_GLbitfield (E e)
 Gets the GLbitfield value from an enum class. More...
 
ClearBit operator| (ClearBit left, ClearBit right)
 Overloaded OR operator for the clear buffer bit. More...
 
SIMPLEGL_VK_EXPORT void initVK ()
 Initializes the Vulkan backend, this will also check available extensions and should be called after sgl::init(). More...
 

Variables

SIMPLEGL_GL_EXPORT GLVersion contextVersion
 Stores the OpenGL version structure. More...
 

Detailed Description

Generic namespace for the SimpleGL framework.

Enumeration Type Documentation

enum sgl::Action
strong

This enum wraps the GLFW actions.

Enumerator
PRESS 

Equivalent to GLFW_PRESS.

RELEASE 

Equivalent to GLFW_RELEASE.

REPEAT 

Equivalent to GLFW_REPEAT.

Definition at line 440 of file input.hpp.

enum sgl::BlendFactor : GLenum
strong

This enum wraps the blend factos.

Enumerator
ZERO 

Equivalent to GL_ZERO.

ONE 

Equivalent to GL_ONE.

SRC_COLOR 

Equivalent to GL_SRC_COLOR.

ONE_MINUS_SRC_COLOR 

Equivalent to GL_ONE_MINUS_SRC_COLOR.

DST_COLOR 

Equivalent to GL_DST_COLOR.

ONE_MINUS_DST_COLOR 

Equivalent to GL_ONE_MINUS_DST_COLOR.

SRC_ALPHA 

Equivalent to GL_SRC_ALPHA.

ONE_MINUS_SRC_ALPHA 

Equivalent to GL_ONE_MINUS_SRC_ALPHA.

DST_ALPHA 

Equivalent to GL_DST_ALPHA.

ONE_MINUS_DST_ALPHA 

Equivalent to GL_ONE_MINUS_DST_ALPHA.

CONSTANT_COLOR 

Equivalent to GL_CONSTANT_COLOR.

ONE_MINUS_CONSTANT_COLOR 

Equivalent to GL_ONE_MINUS_CONSTANT_COLOR.

CONSTANT_ALPHA 

Equivalent to GL_CONSTANT_ALPHA.

ONE_MINUS_CONSTANT_ALPHA 

Equivalent to GL_ONE_MINUS_CONSTANT_ALPHA.

SRC_ALPHA_SATURATE 

Equivalent to GL_SRC_ALPHA_SATURATE.

SRC1_COLOR 

Equivalent to GL_SRC1_COLOR.

ONE_MINUS_SRC1_COLOR 

Equivalent to GL_ONE_MINUS_SRC1_COLOR.

SRC1_ALPHA 

Equivalent to GL_SRC1_ALPHA.

ONE_MINUS_SRC1_ALPHA 

Equivalent to GL_ONE_MINUS_SRC1_ALPHA.

Definition at line 89 of file gl_general.hpp.

enum sgl::BufferTarget : GLenum
strong

This enum wraps the buffer object's targets.

Enumerator
ARRAY_BUFFER 

Equivalent to GL_ARRAY_BUFFER.

ELEMENT_ARRAY_BUFFER 

Equivalent to GL_ELEMENT_ARRAY_BUFFER.

Definition at line 26 of file vertex_buffer_object.hpp.

enum sgl::BufferUsage : GLenum
strong

This enum wraps the buffer object's usages.

Enumerator
STATIC_DRAW 

Equivalent to GL_STATIC_DRAW.

STATIC_READ 

Equivalent to GL_STATIC_READ.

STATIC_COPY 

Equivalent to GL_STATIC_COPY.

DYNAMIC_DRAW 

Equivalent to GL_DYNAMIC_DRAW.

DYNAMIC_READ 

Equivalent to GL_DYNAMIC_READ.

DYNAMIC_COPY 

Equivalent to GL_DYNAMIC_COPY.

STREAM_DRAW 

Equivalent to GL_STREAM_DRAW.

STREAM_READ 

Equivalent to GL_STREAM_READ.

STREAM_COPY 

Equivalent to GL_STREAM_COPY.

Definition at line 40 of file vertex_buffer_object.hpp.

enum sgl::Capability : GLenum
strong

This enum wraps OpenGL capabilities.

Enumerator
BLEND 

Equivalent to GL_BLEND.

CULL_FACE 

Equivalent to GL_BLEND.

DEPTH_TEST 

Equivalent to GL_DEPTH_TEST.

Definition at line 26 of file gl_general.hpp.

enum sgl::ClearBit : GLbitfield
strong

This enum wraps the clear buffer bits.

Enumerator
COLOR_BUFFER_BIT 

Equivalent to GL_COLOR_BUFFER_BIT.

DEPTH_BUFFER_BIT 

Equivalent to GL_DEPTH_BUFFER_BIT.

STENCIL_BUFFER_BIT 

Equivalent to GL_STENCIL_BUFFER_BIT.

Definition at line 43 of file gl_general.hpp.

enum sgl::CullFaceMode : GLenum
strong

This enum wraps the face culling modes.

Enumerator
FRONT 

Equivalent to GL_FRONT.

BACK 

Equivalent to GL_BACK.

FRONT_AND_BACK 

Equivalent to GL_FRONT_AND_BACK.

Definition at line 154 of file gl_general.hpp.

enum sgl::DepthFunction : GLenum
strong

This enum wraps the depth functions.

Enumerator
NEVER 

Equivalent to GL_NEVER.

LESS 

Equivalent to GL_LESS.

EQUAL 

Equivalent to GL_EQUAL.

LEQUAL 

Equivalent to GL_LEQUAL.

GREATER 

Equivalent to GL_GREATER.

NOTEQUAL 

Equivalent to GL_NOTEQUAL.

GEQUAL 

Equivalent to GL_GEQUAL.

ALWAYS 

Equivalent to GL_ALWAYS.

Definition at line 171 of file gl_general.hpp.

enum sgl::EventType
strong

This enum contains different event types.

Enumerator
KEY_EVENT 

Constant for a key event.

This event gets created by the key callback.

MOUSE_BUTTON_EVENT 

Constant for a mouse button event.

This event get created by the mouse button callback.

Definition at line 24 of file event.hpp.

enum sgl::Key
strong

This enum wraps the GLFW keys.

Enumerator
KEY_UNKNOWN 

Equivalent to GLFW_KEY_UNKNOWN.

KEY_SPACE 

Equivalent to GLFW_KEY_SPACE.

KEY_APOSTROPHE 

Equivalent to GLFW_KEY_APOSTROPHE.

KEY_COMMA 

Equivalent to GLFW_KEY_COMMA.

KEY_MINUS 

Equivalent to GLFW_KEY_MINUS.

KEY_PERIOD 

Equivalent to GLFW_KEY_PERIOD.

KEY_SLASH 

Equivalent to GLFW_KEY_SLASH.

KEY_0 

Equivalent to GLFW_KEY_0.

KEY_1 

Equivalent to GLFW_KEY_1.

KEY_2 

Equivalent to GLFW_KEY_2.

KEY_3 

Equivalent to GLFW_KEY_3.

KEY_4 

Equivalent to GLFW_KEY_4.

KEY_5 

Equivalent to GLFW_KEY_5.

KEY_6 

Equivalent to GLFW_KEY_6.

KEY_7 

Equivalent to GLFW_KEY_7.

KEY_8 

Equivalent to GLFW_KEY_8.

KEY_9 

Equivalent to GLFW_KEY_9.

KEY_SEMICOLON 

Equivalent to GLFW_KEY_SEMICOLON.

KEY_EQUAL 

Equivalent to GLFW_KEY_EQUAL.

KEY_A 

Equivalent to GLFW_KEY_A.

KEY_B 

Equivalent to GLFW_KEY_B.

KEY_C 

Equivalent to GLFW_KEY_C.

KEY_D 

Equivalent to GLFW_KEY_D.

KEY_E 

Equivalent to GLFW_KEY_E.

KEY_F 

Equivalent to GLFW_KEY_F.

KEY_G 

Equivalent to GLFW_KEY_G.

KEY_H 

Equivalent to GLFW_KEY_H.

KEY_I 

Equivalent to GLFW_KEY_I.

KEY_J 

Equivalent to GLFW_KEY_J.

KEY_K 

Equivalent to GLFW_KEY_K.

KEY_L 

Equivalent to GLFW_KEY_L.

KEY_M 

Equivalent to GLFW_KEY_M.

KEY_N 

Equivalent to GLFW_KEY_N.

KEY_O 

Equivalent to GLFW_KEY_O.

KEY_P 

Equivalent to GLFW_KEY_P.

KEY_Q 

Equivalent to GLFW_KEY_Q.

KEY_R 

Equivalent to GLFW_KEY_R.

KEY_S 

Equivalent to GLFW_KEY_S.

KEY_T 

Equivalent to GLFW_KEY_T.

KEY_U 

Equivalent to GLFW_KEY_U.

KEY_V 

Equivalent to GLFW_KEY_V.

KEY_W 

Equivalent to GLFW_KEY_W.

KEY_X 

Equivalent to GLFW_KEY_X.

KEY_Y 

Equivalent to GLFW_KEY_Y.

KEY_Z 

Equivalent to GLFW_KEY_Z.

KEY_LEFT_BRACKET 

Equivalent to GLFW_KEY_LEFT_BRACKET.

KEY_BACKSLASH 

Equivalent to GLFW_KEY_BACKSLASH.

KEY_RIGHT_BRACKET 

Equivalent to GLFW_KEY_RIGHT_BRACKET.

KEY_GRAVE_ACCENT 

Equivalent to GLFW_KEY_GRAVE_ACCENT.

KEY_WORLD_1 

Equivalent to GLFW_KEY_WORLD_1.

KEY_WORLD_2 

Equivalent to GLFW_KEY_WORLD_2.

KEY_ESCAPE 

Equivalent to GLFW_KEY_ESCAPE.

KEY_ENTER 

Equivalent to GLFW_KEY_ENTER.

KEY_TAB 

Equivalent to GLFW_KEY_TAB.

KEY_BACKSPACE 

Equivalent to GLFW_KEY_BACKSPACE.

KEY_INSERT 

Equivalent to GLFW_KEY_INSERT.

KEY_DELETE 

Equivalent to GLFW_KEY_DELETE.

KEY_RIGHT 

Equivalent to GLFW_KEY_RIGHT.

KEY_LEFT 

Equivalent to GLFW_KEY_LEFT.

KEY_DOWN 

Equivalent to GLFW_KEY_DOWN.

KEY_UP 

Equivalent to GLFW_KEY_UP.

KEY_PAGE_UP 

Equivalent to GLFW_KEY_PAGE_UP.

KEY_PAGE_DOWN 

Equivalent to GLFW_KEY_PAGE_DOWN.

KEY_HOME 

Equivalent to GLFW_KEY_HOME.

KEY_END 

Equivalent to GLFW_KEY_END.

KEY_CAPS_LOCK 

Equivalent to GLFW_KEY_CAPS_LOCK.

KEY_SCROLL_LOCK 

Equivalent to GLFW_KEY_SCROLL_LOCK.

KEY_NUM_LOCK 

Equivalent to GLFW_KEY_NUM_LOCK.

KEY_PRINT_SCREEN 

Equivalent to GLFW_KEY_PRINT_SCREEN.

KEY_PAUSE 

Equivalent to GLFW_KEY_PAUSE.

KEY_F1 

Equivalent to GLFW_KEY_F1.

KEY_F2 

Equivalent to GLFW_KEY_F2.

KEY_F3 

Equivalent to GLFW_KEY_F3.

KEY_F4 

Equivalent to GLFW_KEY_F4.

KEY_F5 

Equivalent to GLFW_KEY_F5.

KEY_F6 

Equivalent to GLFW_KEY_F6.

KEY_F7 

Equivalent to GLFW_KEY_F7.

KEY_F8 

Equivalent to GLFW_KEY_F8.

KEY_F9 

Equivalent to GLFW_KEY_F9.

KEY_F10 

Equivalent to GLFW_KEY_F10.

KEY_F11 

Equivalent to GLFW_KEY_F11.

KEY_F12 

Equivalent to GLFW_KEY_F12.

KEY_F13 

Equivalent to GLFW_KEY_F13.

KEY_F14 

Equivalent to GLFW_KEY_F14.

KEY_F15 

Equivalent to GLFW_KEY_F15.

KEY_F16 

Equivalent to GLFW_KEY_F16.

KEY_F17 

Equivalent to GLFW_KEY_F17.

KEY_F18 

Equivalent to GLFW_KEY_F18.

KEY_F19 

Equivalent to GLFW_KEY_F19.

KEY_F20 

Equivalent to GLFW_KEY_F20.

KEY_F21 

Equivalent to GLFW_KEY_F21.

KEY_F22 

Equivalent to GLFW_KEY_F22.

KEY_F23 

Equivalent to GLFW_KEY_F23.

KEY_F24 

Equivalent to GLFW_KEY_F24.

KEY_F25 

Equivalent to GLFW_KEY_F25.

KEY_KP_0 

Equivalent to GLFW_KEY_KP_0.

KEY_KP_1 

Equivalent to GLFW_KEY_KP_1.

KEY_KP_2 

Equivalent to GLFW_KEY_KP_2.

KEY_KP_3 

Equivalent to GLFW_KEY_KP_3.

KEY_KP_4 

Equivalent to GLFW_KEY_KP_4.

KEY_KP_5 

Equivalent to GLFW_KEY_KP_5.

KEY_KP_6 

Equivalent to GLFW_KEY_KP_6.

KEY_KP_7 

Equivalent to GLFW_KEY_KP_7.

KEY_KP_8 

Equivalent to GLFW_KEY_KP_8.

KEY_KP_9 

Equivalent to GLFW_KEY_KP_9.

KEY_KP_DECIMAL 

Equivalent to GLFW_KEY_KP_DECIMAL.

KEY_KP_DIVIDE 

Equivalent to GLFW_KEY_KP_DIVIDE.

KEY_KP_MULTIPLY 

Equivalent to GLFW_KEY_KP_MULTIPLY.

KEY_KP_SUBTRACT 

Equivalent to GLFW_KEY_KP_SUBTRACT.

KEY_KP_ADD 

Equivalent to GLFW_KEY_KP_ADD.

KEY_KP_ENTER 

Equivalent to GLFW_KEY_KP_ENTER.

KEY_KP_EQUAL 

Equivalent to GLFW_KEY_KP_EQUAL.

KEY_LEFT_SHIFT 

Equivalent to GLFW_KEY_LEFT_SHIFT.

KEY_LEFT_CONTROL 

Equivalent to GLFW_KEY_LEFT_CONTROL.

KEY_LEFT_ALT 

Equivalent to GLFW_KEY_LEFT_ALT.

KEY_LEFT_SUPER 

Equivalent to GLFW_KEY_LEFT_SUPER.

KEY_RIGHT_SHIFT 

Equivalent to GLFW_KEY_RIGHT_SHIFT.

KEY_RIGHT_CONTROL 

Equivalent to GLFW_KEY_RIGHT_CONTROL.

KEY_RIGHT_ALT 

Equivalent to GLFW_KEY_RIGHT_ALT.

KEY_RIGHT_SUPER 

Equivalent to GLFW_KEY_RIGHT_SUPER.

KEY_MENU 

Equivalent to GLFW_KEY_MENU.

KEY_LAST 

Equivalent to KEY_MENU.

Definition at line 22 of file input.hpp.

enum sgl::MapAccess : GLenum
strong

This enum wraps the buffer object's map accesses.

Enumerator
READ_ONLY 

Equivalent to GL_READ_ONLY.

WRITE_ONLY 

Equivalent to GL_WRITE_ONLY.

READ_WRITE 

Equivalent to GL_READ_WRITE.

Definition at line 75 of file vertex_buffer_object.hpp.

enum sgl::MapRangeAccess : GLbitfield
strong

This enum wraps the buffer object's map range access bits.

Enumerator
MAP_READ_BIT 

Equivalent to GL_MAP_READ_BIT.

MAP_WRITE_BIT 

Equivalent to GL_MAP_WRITE_BIT.

Definition at line 92 of file vertex_buffer_object.hpp.

enum sgl::Modifier
strong

This enum wraps the GLFW modifier bits.

Enumerator
MOD_ALT 

Equivalent to GLFW_MOD_ALT.

MOD_CONTROL 

Equivalent to GLFW_MOD_CONTROL.

MOD_SHIFT 

Equivalent to GLFW_MOD_SHIFT.

MOD_SUPER 

Equivalent to GLFW_MOD_SUPER.

Definition at line 457 of file input.hpp.

enum sgl::MouseButton
strong

This enum wraps the GLFW mouse buttons.

Enumerator
MOUSE_BUTTON_1 

Equivalent to GLFW_MOUSE_BUTTON_1.

MOUSE_BUTTON_2 

Equivalent to GLFW_MOUSE_BUTTON_2.

MOUSE_BUTTON_3 

Equivalent to GLFW_MOUSE_BUTTON_3.

MOUSE_BUTTON_4 

Equivalent to GLFW_MOUSE_BUTTON_4.

MOUSE_BUTTON_5 

Equivalent to GLFW_MOUSE_BUTTON_5.

MOUSE_BUTTON_6 

Equivalent to GLFW_MOUSE_BUTTON_6.

MOUSE_BUTTON_7 

Equivalent to GLFW_MOUSE_BUTTON_7.

MOUSE_BUTTON_8 

Equivalent to GLFW_MOUSE_BUTTON_8.

MOUSE_BUTTON_LAST 

Equivalent to MOUSE_BUTTON_8.

MOUSE_BUTTON_LEFT 

Equivalent to MOUSE_BUTTON_1.

MOUSE_BUTTON_MIDDLE 

Equivalent to MOUSE_BUTTON_3.

MOUSE_BUTTON_RIGHT 

Equivalent to MOUSE_BUTTON_2.

Definition at line 396 of file input.hpp.

enum sgl::Primitive : GLenum
strong

This enum wraps Primitive types of OpenGL.

Enumerator
POINTS 

Equivalent to GL_POINTS.

LINES 

Equivalent to GL_LINES.

LINE_STRIP 

Equivalent to GL_LINE_STRIP.

LINE_LOOP 

Equivalent to GL_LINE_LOOP.

TRIANGLES 

Equivalent to GL_TRIANGLES.

TRIANGLE_STRIP 

Equivalent to GL_TRIANGLE_STRIP.

TRIANGLE_FAN 

Equivalent to GL_TRIANGLE_FAN.

Definition at line 60 of file gl_general.hpp.

enum sgl::ShaderStageBit
strong

This enum stores supported shader stage flag bit.

Enumerator
VERTEX_BIT 

Indicates to use VK_SHADER_STAGE_VERTEX_BIT.

FRAGMENT_BIT 

Indicates to use VK_SHADER_STAGE_FRAGMENT_BIT.

Definition at line 24 of file shader_module.hpp.

enum sgl::ShaderType : GLenum
strong

This enum wraps the shader types.

Enumerator
VERTEX_SHADER 

Equivalent to GL_VERTEX_SHADER.

FRAGMENT_SHADER 

Equivalent to GL_FRAGMENT_SHADER.

Definition at line 26 of file shader_objects.hpp.

enum sgl::TextureFilter : GLint
strong

This enum wraps the texture object's filter.

Enumerator
NEAREST 

Equivalent to GL_NEAREST.

LINEAR 

Equivalent to GL_LINEAR.

Definition at line 22 of file texture_object.hpp.

enum sgl::TextureWrap : GLint
strong

This enum wraps the texture object's wrapping functions.

Enumerator
CLAMP_TO_EDGE 

Equivalent to GL_CLAMP_TO_EDGE.

CLAMP_TO_BORDER 

Equivalent to GL_CLAMP_TO_BORDER.

REPEAT 

Equivalent to GL_REPEAT.

MIRRORED_REPEAT 

Equivalent to GL_MIRRORED_REPEAT.

Definition at line 36 of file texture_object.hpp.

enum sgl::ValueType : GLenum
strong

This enum wraps the vertex array object's value types.

Enumerator
BYTE 

Equivalent to GL_BYTE.

UNSIGNED_BYTE 

Equivalent to GL_UNSIGNED_BYTE.

SHORT 

Equivalent to GL_SHORT.

UNSIGNED_SHORT 

Equivalent to GL_UNSIGNED_SHORT.

INT 

Equivalent to GL_INT.

UNSIGNED_INT 

Equivalent to GL_UNSIGNED_INT.

FLOAT 

Equivalent to GL_FLOAT.

DOUBLE 

Equivalent to GL_DOUBLE.

Definition at line 22 of file vertex_array_object.hpp.

Function Documentation

void sgl::init ( )

Initializes SimpleGL and should be called before anything else.

Definition at line 20 of file core.cpp.

void sgl::initGL ( )

Initializes the OpenGL backend, this will also check available extensions and should be called after sgl::init().

Definition at line 55 of file backend_gl.cpp.

void sgl::initVK ( )

Initializes the Vulkan backend, this will also check available extensions and should be called after sgl::init().

Definition at line 26 of file backend_vk.cpp.

ClearBit sgl::operator| ( ClearBit  left,
ClearBit  right 
)
inline

Overloaded OR operator for the clear buffer bit.

Parameters
leftThe left clear buffer bit.
rightThe right clear buffer bit.

Definition at line 204 of file gl_general.hpp.

Modifier sgl::operator| ( Modifier  left,
Modifier  right 
)
inline

Overloaded OR operator for the modifier bit.

Parameters
leftThe left modifier bit.
rightThe right modifier bit.

Definition at line 478 of file input.hpp.

template<typename E >
GLbitfield sgl::to_GLbitfield ( e)

Gets the GLbitfield value from an enum class.

Parameters
eThe type of the enum class.
Returns
The underlying GLbitfield value.

Definition at line 27 of file backend_gl.tcc.

template<typename E >
GLenum sgl::to_GLenum ( e)

Gets the GLenum value from an enum class.

Parameters
eThe type of the enum class.
Returns
The underlying GLenum value.

Definition at line 22 of file backend_gl.tcc.

template<typename E >
GLint sgl::to_GLint ( e)

Gets the GLint value from an enum class.

Parameters
eThe type of the enum class.
Returns
The underlying GLint value.

Definition at line 17 of file backend_gl.tcc.

Variable Documentation

GLVersion sgl::contextVersion

Stores the OpenGL version structure.

Definition at line 19 of file backend_gl.cpp.