projects
/
glBitmap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c46e25
)
* some small OpenGLES fixes
master
author
Bergmann89
<info@bergmann89.de>
Fri, 6 Mar 2015 17:48:00 +0000
(18:48 +0100)
committer
Bergmann89
<info@bergmann89.de>
Fri, 6 Mar 2015 17:48:00 +0000
(18:48 +0100)
glBitmap.pas
patch
|
blob
|
history
diff --git
a/glBitmap.pas
b/glBitmap.pas
index
9f3706b
..
165ee38
100644
(file)
--- a/
glBitmap.pas
+++ b/
glBitmap.pas
@@
-1063,11
+1063,11
@@
type
public
{ bind texture
@param aEnableTextureUnit enable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D)) }
public
{ bind texture
@param aEnableTextureUnit enable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D)) }
- procedure Bind(
const aEnableTextureUnit: Boolean = true
); virtual;
+ procedure Bind(
{$IFNDEF OPENGL_ES}const aEnableTextureUnit: Boolean = true{$ENDIF}
); virtual;
{ bind texture
@param aDisableTextureUnit disable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D)) }
{ bind texture
@param aDisableTextureUnit disable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D)) }
- procedure Unbind(
const aDisableTextureUnit: Boolean = true
); virtual;
+ procedure Unbind(
{$IFNDEF OPENGL_ES}const aDisableTextureUnit: Boolean = true{$ENDIF}
); virtual;
{ upload texture data from given data object to video card
@param aData texture data object that contains the actual data
{ upload texture data from given data object to video card
@param aData texture data object that contains the actual data
@@
-1180,12
+1180,12
@@
type
{ bind texture
@param aEnableTexCoordsGen enable cube map generator
@param aEnableTextureUnit enable texture unit }
{ bind texture
@param aEnableTexCoordsGen enable cube map generator
@param aEnableTextureUnit enable texture unit }
- procedure Bind({$IFNDEF OPENGL_ES}const aEnableTexCoordsGen: Boolean = true;
{$ENDIF} const aEnableTextureUnit: Boolean = true
); reintroduce; virtual;
+ procedure Bind({$IFNDEF OPENGL_ES}const aEnableTexCoordsGen: Boolean = true;
const aEnableTextureUnit: Boolean = true{$ENDIF}
); reintroduce; virtual;
{ unbind texture
@param aDisableTexCoordsGen disable cube map generator
@param aDisableTextureUnit disable texture unit }
{ unbind texture
@param aDisableTexCoordsGen disable cube map generator
@param aDisableTextureUnit disable texture unit }
- procedure Unbind({$IFNDEF OPENGL_ES}const aDisableTexCoordsGen: Boolean = true;
{$ENDIF} const aDisableTextureUnit: Boolean = true
); reintroduce; virtual;
+ procedure Unbind({$IFNDEF OPENGL_ES}const aDisableTexCoordsGen: Boolean = true;
const aDisableTextureUnit: Boolean = true{$ENDIF}
); reintroduce; virtual;
end;
{$IFEND}
end;
{$IFEND}
@@
-8110,7
+8110,7
@@
begin
{$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_EXT)}
if GL_EXT_texture_filter_anisotropic then begin
if fAnisotropic > 0 then begin
{$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_EXT)}
if GL_EXT_texture_filter_anisotropic then begin
if fAnisotropic > 0 then begin
- Bind(
false
);
+ Bind(
{$IFNDEF OPENGL_ES}false{$ENDIF}
);
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, @MaxAnisotropic);
if aValue > MaxAnisotropic then
fAnisotropic := MaxAnisotropic;
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, @MaxAnisotropic);
if aValue > MaxAnisotropic then
fAnisotropic := MaxAnisotropic;
@@
-8131,7
+8131,7
@@
begin
if (ID <> 0) then
glDeleteTextures(1, @fID);
glGenTextures(1, @fID);
if (ID <> 0) then
glDeleteTextures(1, @fID);
glGenTextures(1, @fID);
- Bind(
false
);
+ Bind(
{$IFNDEF OPENGL_ES}false{$ENDIF}
);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@
-8153,14
+8153,14
@@
begin
aBuildWithGlu := false;
if (MipMap = mmMipmap) then begin
if (GL_VERSION_1_4 or GL_SGIS_generate_mipmap) then
aBuildWithGlu := false;
if (MipMap = mmMipmap) then begin
if (GL_VERSION_1_4 or GL_SGIS_generate_mipmap) then
- glTexParameteri(Target, GL_GENERATE_MIPMAP, GL
_TRUE
)
+ glTexParameteri(Target, GL_GENERATE_MIPMAP, GL
int(GL_TRUE)
)
else
aBuildWithGlu := true;
end else if (MipMap = mmMipmapGlu) then
aBuildWithGlu := true;
{$ELSE}
if (MipMap = mmMipmap) then
else
aBuildWithGlu := true;
end else if (MipMap = mmMipmapGlu) then
aBuildWithGlu := true;
{$ELSE}
if (MipMap = mmMipmap) then
- gl
TexParameteri(Target, GL_GENERATE_MIPMAP, GL_TRUE
);
+ gl
GenerateMipmap(Target
);
{$ENDIF}
end;
{$ENDIF}
end;
@@
-8243,7
+8243,7
@@
begin
//apply filter
if (ID > 0) then begin
//apply filter
if (ID > 0) then begin
- Bind(
false
);
+ Bind(
{$IFNDEF OPENGL_ES}false{$ENDIF}
);
glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, fFilterMag);
if (MipMap = mmNone) {$IFNDEF OPENGL_ES}or (Target = GL_TEXTURE_RECTANGLE){$ENDIF} then begin
glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, fFilterMag);
if (MipMap = mmNone) {$IFNDEF OPENGL_ES}or (Target = GL_TEXTURE_RECTANGLE){$ENDIF} then begin
@@
-8315,7
+8315,7
@@
begin
CheckAndSetWrap(R, fWrapR);
if (ID > 0) then begin
CheckAndSetWrap(R, fWrapR);
if (ID > 0) then begin
- Bind(
false
);
+ Bind(
{$IFNDEF OPENGL_ES}false{$ENDIF}
);
glTexParameteri(Target, GL_TEXTURE_WRAP_S, fWrapS);
glTexParameteri(Target, GL_TEXTURE_WRAP_T, fWrapT);
{$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_3_0)}
glTexParameteri(Target, GL_TEXTURE_WRAP_S, fWrapS);
glTexParameteri(Target, GL_TEXTURE_WRAP_T, fWrapT);
{$IF NOT DEFINED(OPENGL_ES) OR DEFINED(OPENGL_ES_3_0)}
@@
-8366,19
+8366,23
@@
end;
{$IFEND}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{$IFEND}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap.Bind(
const aEnableTextureUnit: Boolean
);
+procedure TglBitmap.Bind(
{$IFNDEF OPENGL_ES}const aEnableTextureUnit: Boolean{$ENDIF}
);
begin
begin
+{$IFNDEF OPENGL_ES}
if aEnableTextureUnit then
glEnable(Target);
if aEnableTextureUnit then
glEnable(Target);
+{$ENDIF}
if (ID > 0) then
glBindTexture(Target, ID);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (ID > 0) then
glBindTexture(Target, ID);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap.Unbind(
const aDisableTextureUnit: Boolean
);
+procedure TglBitmap.Unbind(
{$IFNDEF OPENGL_ES}const aDisableTextureUnit: Boolean{$ENDIF}
);
begin
begin
+{$IFNDEF OPENGL_ES}
if aDisableTextureUnit then
glDisable(Target);
if aDisableTextureUnit then
glDisable(Target);
+{$ENDIF}
glBindTexture(Target, 0);
end;
glBindTexture(Target, 0);
end;
@@
-8519,7
+8523,7
@@
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TglBitmap2D/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TglBitmap2D/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmap2D.UploadDataIntern(const aDataObj: TglBitmapData; const aTarget: GLenum
; const aBuildWithGlu: Boolean
);
+procedure TglBitmap2D.UploadDataIntern(const aDataObj: TglBitmapData; const aTarget: GLenum
{$IFNDEF OPENGL_ES}; const aBuildWithGlu: Boolean{$ENDIF}
);
var
fd: TglBitmapFormatDescriptor;
begin
var
fd: TglBitmapFormatDescriptor;
begin
@@
-8684,9
+8688,9
@@
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmapCubeMap.Bind({$IFNDEF OPENGL_ES}const aEnableTexCoordsGen: Boolean;
{$ENDIF} const aEnableTextureUnit: Boolean
);
+procedure TglBitmapCubeMap.Bind({$IFNDEF OPENGL_ES}const aEnableTexCoordsGen: Boolean;
const aEnableTextureUnit: Boolean{$ENDIF}
);
begin
begin
- inherited Bind
(aEnableTextureUnit
);
+ inherited Bind
({$IFNDEF OPENGL_ES}aEnableTextureUnit{$ENDIF}
);
{$IFNDEF OPENGL_ES}
if aEnableTexCoordsGen then begin
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, fGenMode);
{$IFNDEF OPENGL_ES}
if aEnableTexCoordsGen then begin
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, fGenMode);
@@
-8700,9
+8704,9
@@
begin
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-procedure TglBitmapCubeMap.Unbind({$IFNDEF OPENGL_ES}const aDisableTexCoordsGen: Boolean;
{$ENDIF} const aDisableTextureUnit: Boolean
);
+procedure TglBitmapCubeMap.Unbind({$IFNDEF OPENGL_ES}const aDisableTexCoordsGen: Boolean;
const aDisableTextureUnit: Boolean{$ENDIF}
);
begin
begin
- inherited Unbind(
aDisableTextureUnit
);
+ inherited Unbind(
{$IFNDEF OPENGL_ES}aDisableTextureUnit{$ENDIF}
);
{$IFNDEF OPENGL_ES}
if aDisableTexCoordsGen then begin
glDisable(GL_TEXTURE_GEN_S);
{$IFNDEF OPENGL_ES}
if aDisableTexCoordsGen then begin
glDisable(GL_TEXTURE_GEN_S);