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);
GLint spotCutoff
Spot light cutoff.
Definition: glutil.h:152
GLint specular
Specular color.
Definition: glutil.h:144
std::unique_ptr< CDevice > CreateDevice(const DeviceConfig &config, const std::string &name)
Creates OpenGL device.
Definition: glutil.cpp:72
GLint position
Position or direction vector.
Definition: glutil.h:138
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
GLint attenuation
Attenuation.
Definition: glutil.h:146
GLint ambient
Ambient color.
Definition: glutil.h:140
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
GLint enabled
true enables light
Definition: glutil.h:134
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
GLint type
Light type.
Definition: glutil.h:136
Vector struct and related functions.
int GetOpenGLVersion()
Returns OpenGL version.
Definition: glutil.cpp:91
GLint spotExponent
Spot light exponent.
Definition: glutil.h:150
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
GLint diffuse
Diffuse color.
Definition: glutil.h:142
GLint spotDirection
Spot light direction.
Definition: glutil.h:148
bool CheckGLErrors()
Checks for OpenGL errors.
Definition: glutil.cpp:313