aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu/UDisplay.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-02 04:39:22 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-02 04:39:22 +0000
commitb29759fbfdd8a013e3d0a85b578934ebec028c41 (patch)
treedb75c93eea11c5e9f7d477be4f94b5dfe7559626 /Game/Code/Menu/UDisplay.pas
parentbcf55203a81aef383d0a7123996e872fa3a297dc (diff)
downloadusdx-b29759fbfdd8a013e3d0a85b578934ebec028c41.tar.gz
usdx-b29759fbfdd8a013e3d0a85b578934ebec028c41.tar.xz
usdx-b29759fbfdd8a013e3d0a85b578934ebec028c41.zip
Fixed linux compilation.
Linux is now running in the main loop fine. * no audio playback or input yet... * Timing hack inplace.. that must be replace * bunch of textures not working.. however the play screen is looking similar to windows builds. I hope this dosnt break windows builds to much. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@460 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Menu/UDisplay.pas90
1 files changed, 49 insertions, 41 deletions
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 077342d3..c83d3c37 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -19,45 +19,41 @@ uses {$IFDEF win32}
type
TDisplay = class
- ActualScreen: PMenu;
- NextScreen: PMenu;
+ ActualScreen : PMenu;
+ NextScreen : PMenu;
//fade-to-black-hack
BlackScreen: Boolean;
+
//popup hack
NextScreenWithCheck: Pmenu;
- CheckOK: Boolean;
+ CheckOK : Boolean;
- h_DC: HDC;
- h_RC: HGLRC;
+ h_DC : HDC;
+ h_RC : HGLRC;
- Fade: Real;
- // fade-mod
- doFade: Boolean;
- canFade: Boolean;
- myFade: integer;
- lastTime: Cardinal;
+ Fade : Real;
+ doFade : Boolean;
+ canFade : Boolean;
+ myFade : integer;
+ lastTime : Cardinal;
pTexData : Pointer;
- pTex : array[1..2] of glUInt;
- // end
+ pTex : array[1..2] of glUInt;
- //FPS Counter
- FPSCounter: Cardinal;
- LastFPS: Cardinal;
- NextFPSSwap:Cardinal;
+ FPSCounter : Cardinal;
+ LastFPS : Cardinal;
+ NextFPSSwap : Cardinal;
- //For Debug OSD
- OSD_LastError: String;
+ OSD_LastError : String;
+ public
+ constructor Create;
+ destructor Destroy; override;
- function Draw: Boolean;
procedure PrintScreen;
- constructor Create;
- // fade mod
- destructor Destroy; override;
- // end
procedure ScreenShot;
-
procedure DrawDebugInformation;
+
+ function Draw: Boolean;
end;
var
@@ -76,7 +72,7 @@ uses
{$ENDIF}
graphics,
TextGL,
- // UFiles,
+// ULog,
UMain,
UTexture,
UIni,
@@ -85,15 +81,17 @@ uses
UCommandLine;
constructor TDisplay.Create;
-var i: integer;
+var
+ i: integer;
+
begin
inherited Create;
//popup hack
- CheckOK:=False;
- NextScreen:=NIL;
- NextScreenWithCheck:=NIL;
- BlackScreen:=False;
+ CheckOK := False;
+ NextScreen := NIL;
+ NextScreenWithCheck := NIL;
+ BlackScreen := False;
// fade mod
myfade:=0;
@@ -106,24 +104,37 @@ begin
canFade:=True;
// generate texture for fading between screens
GetMem(pTexData, 512*512*4);
+
if pTexData <> NIL then
for i:= 1 to 2 do
begin
- glGenTextures(1, pTex[i]);
- if glGetError <> GL_NO_ERROR then canFade := False;
+
+ glGenTextures(1, @pTex[i] );
+
+ if glGetError <> GL_NO_ERROR then
+ canFade := False;
+
glBindTexture(GL_TEXTURE_2D, pTex[i]);
- if glGetError <> GL_NO_ERROR then canFade := False;
+ if glGetError <> GL_NO_ERROR then
+ canFade := False;
+
glTexImage2D(GL_TEXTURE_2D, 0, 4, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexData);
- if glGetError <> GL_NO_ERROR then canFade := False;
+ if glGetError <> GL_NO_ERROR then
+ canFade := False;
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- if glGetError <> GL_NO_ERROR then canFade := False;
+ if glGetError <> GL_NO_ERROR then
+ canFade := False;
+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- if glGetError <> GL_NO_ERROR then canFade := False;
+ if glGetError <> GL_NO_ERROR then
+ canFade := False;
end
else
begin
canFade:=False;
end;
+
FreeMem(pTexData);
// end
@@ -131,25 +142,22 @@ begin
OSD_LastError := 'No Errors';
end;
-// fade mod
destructor TDisplay.Destroy;
begin
if canFade then
glDeleteTextures(1,@pTex);
+
inherited Destroy;
end;
-// end
function TDisplay.Draw: Boolean;
var
S: integer;
Col: Real;
- // fade mod
myFade2: Real;
currentTime: Cardinal;
glError: glEnum;
glErrorStr: String;
- // end
begin
Result := True;