interface
uses
- dglOpenGL, sysutils, uglcTypes;
+ {$IFNDEF OPENGL_ES}dglOpenGL{$ELSE}dglOpenGLES{$ENDIF}, sysutils, uglcTypes;
type
EglcArrayBuffer = class(Exception);
procedure BufferData(const aDataCount, aDataSize: Cardinal; const aUsage: TglcBufferUsage; const aData: Pointer);
function MapBuffer(const aAccess: TglcBufferAccess): Pointer;
+ function MapBufferRange(const aOffset: GLintptr; const aSize: GLsizeiptr; const aAccess: TglcBufferAccess): Pointer;
procedure UnmapBuffer;
procedure Bind;
procedure Unbind;
result := nil;
if (fDataCount * fDataSize) <= 0 then
exit;
+{$IFNDEF OPENGL_ES}
result := glMapBuffer(GLenum(fTarget), GLenum(aAccess));
+{$ELSE}
+ if not GL_OES_mapbuffer then
+ raise EglcArrayBuffer.Create('map buffer is not supported by video card');
+ result := glMapBufferOES(GLenum(fTarget), GLenum(aAccess));
+{$ENDIF}
glcCheckAndRaiseError;
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////[c]
+function TglcArrayBuffer.MapBufferRange(const aOffset: GLintptr; const aSize: GLsizeiptr; const aAccess: TglcBufferAccess): Pointer;
+begin
+ {$IFNDEF OPENGL_ES}
+ if not (GL_ARB_map_buffer_range or GL_VERSION_3_0) then
+ raise EglcArrayBuffer.Create('map buffer range is not supported by video card');
+ result := glMapBufferRange(GLenum(fTarget), aOffset, aSize, GLenum(aAccess));
+ {$ELSE}
+ if not GL_VERSION_3_0 then
+ raise EglcArrayBuffer.Create('map buffer range is not supported by video card');
+ result := glMapBufferRange(GLenum(fTarget), aOffset, aSize, GLenum(aAccess));
+ {$ENDIF}
+end;
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////[c]
procedure TglcArrayBuffer.UnmapBuffer;
begin
+{$IFNDEF OPENGL_ES}
glUnmapBuffer(GLenum(fTarget));
+{$ELSE}
+ if not (GL_OES_mapbuffer or GL_VERSION_3_0) then
+ raise EglcArrayBuffer.Create('unmap buffer is not supported by video card');
+ glUnmapBuffer(GLenum(fTarget));
+{$ENDIF}
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////[c]
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////[c]
constructor TglcArrayBuffer.Create(const aTarget: TglcBufferTarget);
begin
- if not GL_ARB_Vertex_Buffer_Object then
+{$IFNDEF OPENGL_ES}
+ if not (GL_ARB_Vertex_Buffer_Object or GL_VERSION_2_0) then
+ raise EglcArrayBuffer.Create('Create - VertexBuffer: not supported');
+{$ELSE}
+ if not GL_VERSION_2_0 then
raise EglcArrayBuffer.Create('Create - VertexBuffer: not supported');
+{$ENDIF}
inherited Create;
glGenBuffers(1, @fID);
fDataCount := 0;
fDataSize := 0;
fTarget := aTarget;
+ glcCheckAndRaiseError;
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////[c]
{$IFEND}
TglcBitmapFormat = TglBitmapFormat;
- TglcBitmap1D = TglBitmap1D;
TglcBitmap2D = TglBitmap2D;
+{$IF NOT DEFINED(OPENGL_ES)}
+ TglcBitmap1D = TglBitmap1D;
+ TglcBitmapCubeMap = TglBitmapCubeMap;
+ TglcBitmapNormalMap = TglBitmapNormalMap;
+{$ELSEIF DEFINED(OPENGL_ES_2_0)}
TglcBitmapCubeMap = TglBitmapCubeMap;
TglcBitmapNormalMap = TglBitmapNormalMap;
-
+{$IFEND}
+
const
NULL_SIZE: TglBitmapPixelPosition = (Fields: []; X: 0; Y: 0);
procedure Perspective(const aFOVAngle, aAspectRatio, aNear, aFar: Single);
procedure Ortho(const aLeft, aRight, aBottom, aTop, aNear, aFar: Single);
procedure Activate;
+{$IFNDEF OPENGL_ES}
procedure Render;
+{$ENDIF}
constructor Create;
end;
implementation
uses
- Math, dglOpenGL;
+ Math, {$IFNDEF OPENGL_ES}dglOpenGL{$ELSE}dglOpenGLES{$ENDIF};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TglcFrustum///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
if fIsOrthogonal then
- glOrtho(fLeft, fRight, fBottom, fTop, fNear, fFar)
+ {$IFNDEF OPENGL_ES}glOrtho{$ELSE}glOrthof{$ENDIF}(fLeft, fRight, fBottom, fTop, fNear, fFar)
else
- glFrustum(fLeft, fRight, fBottom, fTop, fNear, fFar);
+ {$IFNDEF OPENGL_ES}glFrustum{$ELSE}glFrustumf{$ENDIF}(fLeft, fRight, fBottom, fTop, fNear, fFar);
glMatrixMode(GL_MODELVIEW);
end;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+{$IFNDEF OPENGL_ES}
procedure TglcFrustum.Render;
var
min, max: TgluVector2f;
glVertex3f(0, 0, 0); glVertex3f(max[0], min[0], -fFar);
glEnd;
end;
+{$ENDIF}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor TglcFrustum.Create;
interface
uses
- Classes, SysUtils, fgl, dglOpenGl, uglcTypes;
+ Classes, SysUtils, fgl, {$IFNDEF OPENGL_ES}dglOpenGl{$ELSE}dglOpenGLES{$ENDIF}, uglcTypes;
type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
fWidth: Integer;
fHeight: Integer;
fBuffers: TglcAttachmentContainerList;
+{$IFDEF OPENGL_ES}
+ fOldViewport: array[0..3] of GLint;
+{$ENDIF}
function GetBuffer(const aIndex: Integer): TglcBuffer;
procedure SetBuffer(const aIndex: Integer; const aValue: TglcBuffer);
glGenTextures(1, @fID);
Bind(false);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, {$IFNDEF OPENGL_ES}GL_CLAMP{$ELSE}GL_CLAMP_TO_EDGE{$ENDIF});
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, {$IFNDEF OPENGL_ES}GL_CLAMP{$ELSE}GL_CLAMP_TO_EDGE{$ENDIF});
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
Unbind(false);
raise EglcFrameBufferObject.Create('Incomplete attachment');
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
raise EglcFrameBufferObject.Create('Missing attachment');
+{$IFNDEF OPENGL_ES}
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
raise EglcFrameBufferObject.Create('Incomplete dimensions');
GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
raise EglcFrameBufferObject.Create('Incomplete draw buffer');
GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
raise EglcFrameBufferObject.Create('Incomplete read buffer');
+{$ENDIF}
GL_FRAMEBUFFER_UNSUPPORTED:
raise EglcFrameBufferObject.Create('Framebufferobjects unsupported');
end;
var
buff: array of GLenum;
+{$IFNDEF OPENGL_ES}
b: GLboolean;
+{$ENDIF}
i: Integer;
begin
if (fBuffers.Count = 0) then
//set Read and Draw Buffer
if (Length(buff) = 0) then begin
glReadBuffer(GL_NONE);
+{$IFNDEF OPENGL_ES}
glDrawBuffer(GL_NONE);
+{$ELSE}
+ SetLength(buff, 1);
+ buff[0] := GL_NONE;
+ glDrawBuffers(1, @buff[0]);
+{$ENDIF}
end else begin
glDrawBuffers(Length(buff), @buff[0]);
+{$IFNDEF OPENGL_ES}
glGetBooleanv(GL_DOUBLEBUFFER, @b);
if b then
glReadBuffer(GL_BACK)
else
glReadBuffer(GL_FRONT);
+{$ELSE}
+ glReadBuffer(GL_FRONT);
+{$ENDIF}
end;
Unbind(false);
end;
begin
glBindFramebuffer(GL_FRAMEBUFFER, fID);
if aSetViewport then begin
+{$IFNDEF OPENGL_ES}
glPushAttrib(GL_VIEWPORT_BIT);
+{$ELSE}
+ glGetIntegerv(GL_VIEWPORT, @fOldViewport[0]);
+{$ENDIF}
glViewPort(0, 0, fWidth, fHeight);
end;
end;
procedure TglcFrameBufferObject.Unbind(const aResetViewport: Boolean = true);
begin
if aResetViewport then
+{$IFNDEF OPENGL_ES}
glPopAttrib;
+{$ELSE}
+ glViewport(fOldViewport[0], fOldViewport[1], fOldViewport[2], fOldViewport[3]);
+{$ENDIF}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
end;
interface
uses
- Classes, SysUtils, dglOpenGL, ugluVector, uglcTypes;
+ Classes, SysUtils, {$IFNDEF OPENGL_ES}dglOpenGl{$ELSE}dglOpenGLES{$ENDIF}, ugluVector, uglcTypes;
type
TglcMaterialRec = packed record
interface\r
\r
uses\r
- Classes, SysUtils, fgl, dglOpenGL, uglcTypes, ugluMatrix, uglcContext;\r
+ Classes, SysUtils, fgl, {$IFNDEF OPENGL_ES}dglOpenGl{$ELSE}dglOpenGLES{$ENDIF}, uglcTypes, ugluMatrix;\r
\r
type\r
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r
TglcShaderObject = class(TObject)\r
private\r
fAtachedTo: TglcShaderProgram;\r
- fShaderObj: GLHandle;\r
+ fShaderObj: GLuint;\r
fShaderType: TglcShaderType;\r
fCode: String;\r
fOnLog: TglcShaderLogEvent;\r
fAttachedTo: TglcShaderProgram;\r
\r
- function GetInfoLog(aObj: GLHandle): String;\r
+ function GetInfoLog(aObj: GLuint): String;\r
function GetCompiled: Boolean;\r
procedure Log(const aMsg: String);\r
procedure CreateShaderObj;\r
procedure AttachTo(const aProgram: TglcShaderProgram);\r
public\r
- property ShaderObj : GLHandle read fShaderObj;\r
+ property ShaderObj: GLuint read fShaderObj;\r
property ShaderType: TglcShaderType read fShaderType;\r
property Compiled: Boolean read GetCompiled;\r
property AtachedTo: TglcShaderProgram read fAtachedTo;\r
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r
TglcShaderProgram = class(TglcShaderObjectList)\r
private\r
- fProgramObj: GLHandle;\r
+ fProgramObj: GLuint;\r
fOnLog: TglcShaderLogEvent;\r
fFilename: String;\r
\r
function GetUniformLocation(const aName: String; out aPos: glInt): Boolean;\r
- function GetInfoLog(Obj: GLHandle): String;\r
+ function GetInfoLog(Obj: GLuint): String;\r
function GetCompiled: Boolean;\r
function GetLinked: Boolean;\r
\r
procedure Log(const msg: String);\r
procedure AttachShaderObj(const aShaderObj: TglcShaderObject);\r
public\r
- property ProgramObj: glHandle read fProgramObj;\r
+ property ProgramObj: GLuint read fProgramObj;\r
property Filename: String read fFilename;\r
property Compiled: Boolean read GetCompiled;\r
property Linked: Boolean read GetLinked;\r
//ließt das Log eines OpenGL-Objekts aus\r
//@Obj: Handle des Objekts, dessen Log ausgelesen werden soll;\r
//@result: Log des Objekts;\r
-function TglcShaderObject.GetInfoLog(aObj: GLHandle): String;\r
+function TglcShaderObject.GetInfoLog(aObj: GLuint): String;\r
var\r
Msg: PChar;\r
bLen: GLint;\r
//ließt das Log eines OpenGL-Objekts aus\r
//@Obj: Handle des Objekts, dessen Log ausgelesen werden soll;\r
//@result: Log des Objekts;\r
-function TglcShaderProgram.GetInfoLog(Obj: GLHandle): String;\r
+function TglcShaderProgram.GetInfoLog(Obj: GLuint): String;\r
var\r
Msg: PChar;\r
bLen: GLint;\r
procedure TglcShaderProgram.CreateProgramObj;\r
begin\r
if (fProgramObj = 0) then begin\r
- if GL_LibHandle = nil then\r
- raise EglcShader.Create('TglShaderProgram.Create - OpenGL not initialized');\r
-\r
- if not TglcContext.IsAnyContextActive then\r
- raise EglcShader.Create('TglShaderProgram.Create - no valid render context');\r
-\r
fProgramObj := glCreateProgram();\r
Log('shader program created: #'+IntToHex(fProgramObj, 4));\r
end;\r
result := TglcShaderType.stVertex\r
else if (aStr = 'GL_FRAGMENT_SHADER') then\r
result := TglcShaderType.stFragment\r
+{$IFNDEF OPENGL_ES}\r
else if (aStr = 'GL_GEOMETRY_SHADER') then\r
result := TglcShaderType.stGeometry\r
else if (aStr = 'GL_TESS_CONTROL_SHADER') then\r
result := TglcShaderType.stTessControl\r
else if (aStr = 'GL_TESS_EVALUATION_SHADER') then\r
result := TglcShaderType.stTessEvaluation\r
+{$ENDIF}\r
else\r
raise Exception.Create('invalid shader type: ' + aStr);\r
end;\r
case aShaderType of\r
TglcShaderType.stVertex: result := 'GL_VERTEX_SHADER';\r
TglcShaderType.stFragment: result := 'GL_FRAGMENT_SHADER';\r
+{$IFNDEF OPENGL_ES}\r
TglcShaderType.stGeometry: result := 'GL_GEOMETRY_SHADER';\r
TglcShaderType.stTessControl: result := 'GL_TESS_CONTROL_SHADER';\r
TglcShaderType.stTessEvaluation: result := 'GL_TESS_EVALUATION_SHADER';\r
+{$ENDIF}\r
else\r
result := 'UNKNOWN';\r
end;\r
end;\r
\r
end.\r
-\r
\ No newline at end of file
+\r
interface
uses
- dglOpenGL, sysutils;
+ {$IFNDEF OPENGL_ES}dglOpenGL{$ELSE}dglOpenGLES{$ENDIF}, sysutils;
type
TglcFace = (
faBack = GL_BACK,
faBoth = GL_FRONT_AND_BACK);
+{$IFNDEF OPENGL_ES}
TglcPolygonMode = (
pmPoint = GL_POINT,
pmLine = GL_LINE,
pmFill = GL_FILL);
+{$ENDIF}
TglcDepthFunc = (
dfNever = GL_NEVER,
TglcClearBuffer = (
cbDepthBuffer = GL_DEPTH_BUFFER_BIT,
+{$IFNDEF OPENGL_ES}
cbAccumBuffer = GL_ACCUM_BUFFER_BIT,
+{$ENDIF}
cbStencilBuffer = GL_STENCIL_BUFFER_BIT,
cbColorBuffer = GL_COLOR_BUFFER_BIT);
mfLinear = GL_LINEAR);
TglcTextureWrap = (
+{$IFNDEF OPENGL_ES}
twClamp = GL_CLAMP,
+{$ENDIF}
twRepeat = GL_REPEAT,
+{$IFNDEF OPENGL_ES}
twClampToBorder = GL_CLAMP_TO_BORDER,
+{$ENDIF}
twClampToEdge = GL_CLAMP_TO_EDGE,
twMirroredRepeat = GL_MIRRORED_REPEAT);
TglcFormat = (
fmUnknown = 0,
+{$IFNDEF OPENGL_ES}
fmColorIndex = GL_COLOR_INDEX,
+{$ENDIF}
fmDepthComponent = GL_DEPTH_COMPONENT,
fmRed = GL_RED,
fmGreen = GL_GREEN,
fmRGBA = GL_RGBA,
fmLuminance = GL_LUMINANCE,
fmLuminanceAlpha = GL_LUMINANCE_ALPHA,
+{$IFNDEF OPENGL_ES}
fmBGR = GL_BGR,
fmBGRA = GL_BGRA,
+{$ENDIF}
fmDepthStencil = GL_DEPTH_STENCIL);
TglcInternalFormat = (
ifRGBA = GL_RGBA,
ifLuminance = GL_LUMINANCE,
ifLuminanceAlpha = GL_LUMINANCE_ALPHA,
+{$IFNDEF OPENGL_ES}
ifR3G3B2 = GL_R3_G3_B2,
ifAlpha4 = GL_ALPHA4,
ifAlpha8 = GL_ALPHA8,
ifIntensity16 = GL_INTENSITY16,
ifRGB4 = GL_RGB4,
ifRGB5 = GL_RGB5,
+{$ENDIF}
ifRGB8 = GL_RGB8,
+{$IFNDEF OPENGL_ES}
ifRGB10 = GL_RGB10,
ifRGB12 = GL_RGB12,
ifRGB16 = GL_RGB16,
ifRGBA2 = GL_RGBA2,
+{$ENDIF}
ifRGBA4 = GL_RGBA4,
ifRGB5A1 = GL_RGB5_A1,
ifRGBA8 = GL_RGBA8,
ifRGB10A2 = GL_RGB10_A2,
+{$IFNDEF OPENGL_ES}
ifRGBA12 = GL_RGBA12,
ifRGBA16 = GL_RGBA16,
+{$ENDIF}
ifDepthComponent16 = GL_DEPTH_COMPONENT16,
ifDepthComponent24 = GL_DEPTH_COMPONENT24,
+{$IFNDEF OPENGL_ES}
ifDepthComponent32 = GL_DEPTH_COMPONENT32,
ifCompressedAlpha = GL_COMPRESSED_ALPHA,
ifCompressedLuminance = GL_COMPRESSED_LUMINANCE,
ifCompressedIntensity = GL_COMPRESSED_INTENSITY,
ifCompressedRGB = GL_COMPRESSED_RGB,
ifCompressedRGBA = GL_COMPRESSED_RGBA,
+{$ENDIF}
ifRGBA32f = GL_RGBA32F,
ifRGB32f = GL_RGB32F,
ifRGBA16F = GL_RGBA16F,
ifDepth24Stencil8 = GL_DEPTH24_STENCIL8,
ifSRGB = GL_SRGB,
ifSRGB8 = GL_SRGB8,
+{$IFNDEF OPENGL_ES}
ifSRGBA = GL_SRGB_ALPHA,
+{$ENDIF}
ifSRGBA8 = GL_SRGB8_ALPHA8,
+{$IFNDEF OPENGL_ES}
ifSLuminanceAlpha = GL_SLUMINANCE_ALPHA,
ifSLuminance8Alpha8 = GL_SLUMINANCE8_ALPHA8,
ifSLuminance = GL_SLUMINANCE,
ifSLuminance8 = GL_SLUMINANCE8,
+{$ENDIF}
ifDepth32fStencil8 = GL_DEPTH32F_STENCIL8,
+{$IFNDEF OPENGL_ES}
ifStencil1 = GL_STENCIL_INDEX1,
ifStencil4 = GL_STENCIL_INDEX4,
- ifStencil8 = GL_STENCIL_INDEX8,
- ifStencil16 = GL_STENCIL_INDEX16);
+{$ENDIF}
+ ifStencil8 = GL_STENCIL_INDEX8
+{$IFNDEF OPENGL_ES}
+ , ifStencil16 = GL_STENCIL_INDEX16
+{$ENDIF}
+ );
TglcAttachment = (
atDepthStencil = GL_DEPTH_STENCIL_ATTACHMENT,
TglcShaderType = (
stFragment = GL_FRAGMENT_SHADER,
- stVertex = GL_VERTEX_SHADER,
- stGeometry = GL_GEOMETRY_SHADER,
- stTessEvaluation = GL_TESS_EVALUATION_SHADER,
- stTessControl = GL_TESS_CONTROL_SHADER);
+ stVertex = GL_VERTEX_SHADER
+{$IFNDEF OPENGL_ES}
+ , stGeometry = GL_GEOMETRY_SHADER
+ , stTessEvaluation = GL_TESS_EVALUATION_SHADER
+ , stTessControl = GL_TESS_CONTROL_SHADER
+{$ENDIF}
+ );
TglcBufferTarget = (
btArrayBuffer = GL_ARRAY_BUFFER,
end;
procedure glcRenderFace(const aValue: TglcFace); inline;
-procedure glcPolygonMode(const aFace: TglcFace; const aValue: TglcPolygonMode); inline;
procedure glcDepthFunc(const aValue: TglcDepthFunc); inline;
procedure glcBlendFunc(const aSource, aDest: TglcBlendFactor); inline; overload;
procedure glcBlendFunc(const aMode: TglcBlendMode); inline; overload;
procedure glcCheckAndRaiseError;
+{$IFNDEF OPENGL_ES}
+procedure glcPolygonMode(const aFace: TglcFace; const aValue: TglcPolygonMode); inline;
+{$ENDIF}
implementation
end;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure glcPolygonMode(const aFace: TglcFace; const aValue: TglcPolygonMode);
-begin
- glPolygonMode(GLenum(aFace), GLenum(aValue));
-end;
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure glcDepthFunc(const aValue: TglcDepthFunc);
begin
glDepthFunc(GLenum(aValue));
raise EOpenGL.Create(e);
end;
+{$IFNDEF OPENGL_ES}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+procedure glcPolygonMode(const aFace: TglcFace; const aValue: TglcPolygonMode);
+begin
+ glPolygonMode(GLenum(aFace), GLenum(aValue));
+end;
+{$ENDIF}
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//EOpenGL///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor EOpenGL.Create(const aErrorCode: GLenum);
begin
fErrorCode := aErrorCode;
+{$IFNDEF OPENGL_ES}
inherited Create(gluErrorString(fErrorCode));
+{$ELSE}
+ inherited Create('OpenGL Error: ' + IntToHex(fErrorCode, 8));
+{$ENDIF}
end;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
constructor EOpenGL.Create(const aMsg: String; const aErrorCode: GLenum);
begin
fErrorCode := aErrorCode;
+{$IFNDEF OPENGL_ES}
inherited Create(aMsg + ': ' + gluErrorString(fErrorCode))
+{$ELSE}
+ inherited Create(aMsg + ': ' + IntToHex(fErrorCode, 8));
+{$ENDIF}
end;
end.
interface
uses
- Classes, SysUtils, dglOpenGL;
+ Classes, SysUtils, {$IFNDEF OPENGL_ES}dglOpenGL{$ELSE}dglOpenGLES{$ENDIF};
type
//Vektortypen
//@result: absolute Raumkoordianten des Vectors v;
function gluGetAbsCoord(const v: TgluVector3f): TgluVector3f;
var
- v4: TVector4f;
+ v4: TgluVector4f;
sum: Single;
i, j: Integer;
- m: array[0..3, 0..3] of TGLFloat;
+ m: array[0..3, 0..3] of GLfloat;
begin
for i := 0 to 2 do
v4[i] := v[i];