23 #include "common/config.h" 25 #include "common/make_unique.h" 44 enum FramebufferSupport
51 bool InitializeGLEW();
53 FramebufferSupport DetectFramebufferSupport();
56 std::unique_ptr<CDevice>
CreateDevice(
const DeviceConfig &config,
const std::string& name);
82 CompFunc TranslateGLCompFunc(GLenum flag);
84 GLenum TranslateGfxCompFunc(
CompFunc func);
86 BlendFunc TranslateGLBlendFunc(GLenum flag);
88 GLenum TranslateGfxBlendFunc(
BlendFunc func);
92 GLenum TranslateTextureCoordinate(
int index);
94 GLenum TranslateTextureCoordinateGen(
int index);
96 std::string GetLastShaderError();
98 GLint LoadShader(GLint type,
const char* filename);
100 GLint LinkProgram(
int count, GLint shaders[]);
105 SDL_Surface* actualSurface =
nullptr;
106 SDL_Surface* convertedSurface =
nullptr;
107 GLenum sourceFormat = 0;
117 : m_pixels(MakeUniqueArray<GLubyte>(size))
120 void* GetPixelsData()
override 122 return static_cast<void*
>(m_pixels.get());
126 std::unique_ptr<GLubyte[]> m_pixels;
129 std::unique_ptr<CGLFrameBufferPixels> GetGLFrameBufferPixels(
Math::IntPoint size);
146 GLint attenuation = -1;
148 GLint spotDirection = -1;
150 GLint spotExponent = -1;
152 GLint spotCutoff = -1;
159 GLint projectionMatrix = -1;
161 GLint viewMatrix = -1;
163 GLint modelMatrix = -1;
165 GLint shadowMatrix = -1;
167 GLint normalMatrix = -1;
170 GLint primaryTexture = -1;
172 GLint secondaryTexture = -1;
174 GLint shadowTexture = -1;
177 GLint textureEnabled[3] = {};
181 GLint alphaTestEnabled = -1;
183 GLint alphaReference = -1;
186 GLint fogEnabled = -1;
193 GLint shadowColor = -1;
196 GLint lightingEnabled = -1;
198 GLint ambientColor = -1;
200 GLint diffuseColor = -1;
202 GLint specularColor = -1;
std::unique_ptr< CDevice > CreateDevice(const DeviceConfig &config, const std::string &name)
Creates OpenGL device.
Definition: glutil.cpp:72
CompFunc
Type of function used to compare values.
Definition: device.h:183
int ClearGLErrors()
Clears OpenGL errors.
Definition: glutil.cpp:297
TexImgFormat
Format of image data.
Definition: texture.h:42
bool AreExtensionsSupported(std::string list)
Checks if extensions in space-delimited list are supported.
Definition: glutil.cpp:107
std::string GetHardwareInfo(bool full)
Returns information about graphics card.
Definition: glutil.cpp:171
BlendFunc
Type of blending function.
Definition: device.h:199
GLenum TranslateGfxPrimitive(PrimitiveType type)
Translate Gfx primitive type to OpenGL primitive type.
Definition: glutil.cpp:330
PrimitiveType
Type of primitive to render.
Definition: device.h:265
Namespace for (new) graphics code.
Definition: app.h:49
Implementation-specific image data.
Definition: image.h:41
Vector struct and related functions.
int GetOpenGLVersion()
Returns OpenGL version.
Definition: glutil.cpp:91
3D (3x1) vector
Definition: vector.h:53
Abstract graphics device - CDevice class and related structs/enums.
2D Point with integer coords
Definition: intpoint.h:41
bool CheckGLErrors()
Checks for OpenGL errors.
Definition: glutil.cpp:313