Gorgon Game Engine
GL.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdint.h>
4 
5 #include "Geometry/Point.h"
6 #include "Geometry/Size.h"
7 #include "Geometry/Bounds.h"
8 #include "Graphics/Color.h"
9 #include "Utils/Logging.h"
10 #include "Containers/Image.h"
11 
12 namespace Gorgon {
13 
19  namespace GL {
20 
21  class FrameBuffer;
22 
23 #ifdef OPENGL
24  typedef uint32_t Texture;
27 #endif
28 
30  Texture GenerateTexture(const Containers::Image &data);
31 
33  Texture GenerateEmptyTexture(const Geometry::Size &size, Graphics::ColorMode mode);
34 
37  void ResizeTexture(Texture texture, const Geometry::Size &size, Graphics::ColorMode mode);
38 
40  void UpdateTexture(Texture texture, const Containers::Image &data);
41 
43  void CopyToTexture(Texture texture, const Containers::Image &data, Geometry::Point target);
44 
46  void CopyToTexture(Texture texture, const Containers::Image &data, Geometry::Bounds source, Geometry::Point target);
47 
49  void DestroyTexture(Texture texture);
50 
52  void RenderToTexture(FrameBuffer &buffer);
53 
55  void RenderToScreen();
56 
58  void SetupContext(const Geometry::Size &size);
59 
61  void Resize(const Geometry::Size &size);
62 
64  void Clear();
65 
67  void SetDefaultClear();
68 
70  void SetDefaultBlending();
71 
74  }
75 }
Gorgon::Geometry::basic_Bounds
This class represents boundaries of 2D objects.
Definition: Bounds.h:27
Gorgon::GL::GenerateTexture
Texture GenerateTexture(const Containers::Image &data)
This function generates a texture from the given image data.
Definition: OpenGL.cpp:146
Gorgon::GL::Clear
void Clear()
Clears the window pointed by the active context.
Definition: OpenGL.cpp:277
Gorgon::Graphics::ColorMode
ColorMode
Color modes for images.
Definition: Color.h:16
Bounds.h
contains the Bounds class
Point.h
contains point class.
Size.h
contains the Size class
Gorgon::GL::SetupContext
void SetupContext(const Geometry::Size &size)
Performs first time initialization on GL context.
Definition: OpenGL.cpp:225
Color.h
Gorgon::GL::GenerateEmptyTexture
Texture GenerateEmptyTexture(const Geometry::Size &size, Graphics::ColorMode mode)
This function generates a texture from the given image data.
Definition: OpenGL.cpp:154
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Geometry::basic_Size
This class represents a 2D geometric size.
Definition: Size.h:23
Gorgon::GL::SetDefaultClear
void SetDefaultClear()
Sets default clear parameters as current.
Definition: OpenGL.cpp:268
Gorgon::Utils::Logger
Eases logging procedure by appending necessary information to the given data and streams to a standar...
Definition: Logging.h:19
Gorgon::GL::DestroyTexture
void DestroyTexture(Texture texture)
Destroys the given texture.
Definition: OpenGL.cpp:213
Gorgon::GL::ResizeTexture
void ResizeTexture(Texture texture, const Geometry::Size &size, Graphics::ColorMode mode)
Resizes the given texture to the specified size.
Definition: OpenGL.cpp:169
Gorgon::GL::FrameBuffer
This is a frame buffer object that can be used for render to texture tasks.
Definition: FrameBuffer.h:13
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Image.h
Gorgon::Containers::basic_Image
This class is a container for image data.
Definition: Image.h:19
Gorgon::GL::SetDefaultBlending
void SetDefaultBlending()
Sets default blending parameters as current.
Definition: OpenGL.cpp:264
Gorgon::GL::RenderToScreen
void RenderToScreen()
Stops rendering to a texture and start rendering to a buffer.
Definition: OpenGL.cpp:221
Gorgon::GL::RenderToTexture
void RenderToTexture(FrameBuffer &buffer)
Begins using the given frame buffer.
Definition: OpenGL.cpp:217
Gorgon::GL::Resize
void Resize(const Geometry::Size &size)
Resizes the active context.
Definition: OpenGL.cpp:273
Logging.h
Gorgon::GL::CopyToTexture
void CopyToTexture(Texture texture, const Containers::Image &data, Geometry::Point target)
Copies the data from the given image to the texture starting from the given target.
Definition: OpenGL.cpp:181
Gorgon::GL::UpdateTexture
void UpdateTexture(Texture texture, const Containers::Image &data)
Updates the given texture to contain the given data.
Definition: OpenGL.cpp:177
Gorgon::GL::log
Gorgon::Utils::Logger log
The logger that is used for GL operations. Default is unset and will not log anything....
Definition: Shader.cpp:19