index 5b760c29274b77e5fe6fe2e397b045a4d54b3f20..898c208e4bb7e2cc2d75f0481d91cd8851c51c29 100644 (file)
+{$MODE DELPHI}
unit e_graphics;
interface
unit e_graphics;
interface
implementation
implementation
+type
+ LONG = LongInt;
+ BITMAPINFOHEADER = record
+ biSize : DWORD;
+ biWidth : LONG;
+ biHeight : LONG;
+ biPlanes : WORD;
+ biBitCount : WORD;
+ biCompression : DWORD;
+ biSizeImage : DWORD;
+ biXPelsPerMeter : LONG;
+ biYPelsPerMeter : LONG;
+ biClrUsed : DWORD;
+ biClrImportant : DWORD;
+ end;
+ LPBITMAPINFOHEADER = ^BITMAPINFOHEADER;
+ TBITMAPINFOHEADER = BITMAPINFOHEADER;
+ PBITMAPINFOHEADER = ^BITMAPINFOHEADER;
+
+ RGBQUAD = record
+ rgbBlue : BYTE;
+ rgbGreen : BYTE;
+ rgbRed : BYTE;
+ rgbReserved : BYTE;
+ end;
+ tagRGBQUAD = RGBQUAD;
+ TRGBQUAD = RGBQUAD;
+ PRGBQUAD = ^RGBQUAD;
+
+ BITMAPINFO = record
+ bmiHeader : BITMAPINFOHEADER;
+ bmiColors : array[0..0] of RGBQUAD;
+ end;
+ LPBITMAPINFO = ^BITMAPINFO;
+ PBITMAPINFO = ^BITMAPINFO;
+ TBITMAPINFO = BITMAPINFO;
+
+ BITMAPFILEHEADER = packed record
+ bfType : Word;
+ bfSize : DWord;
+ bfReserved1 : Word;
+ bfReserved2 : Word;
+ bfOffBits : DWord;
+ end;
+ tagBITMAPFILEHEADER = BITMAPFILEHEADER;
+
type
TTexture = record
//ID: DWORD;
type
TTexture = record
//ID: DWORD;
Result.X := 0;
Result.Width := w;
Result.Height := h;
Result.X := 0;
Result.Width := w;
Result.Height := h;
-
+
if e_NoGraphics then Exit;
if e_NoGraphics then Exit;
-
+
data := GetMemory(w*h*4);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, e_Textures[ID].tx.id);
data := GetMemory(w*h*4);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, e_Textures[ID].tx.id);
end;
procedure e_MakeScreenshot(FileName: String; Width, Height: Word);
end;
procedure e_MakeScreenshot(FileName: String; Width, Height: Word);
-begin
- if e_NoGraphics then Exit;
-end;
-
-{type
+type
aRGB = Array [0..1] of TRGB;
PaRGB = ^aRGB;
aRGB = Array [0..1] of TRGB;
PaRGB = ^aRGB;
-
TByteArray = Array [0..1] of Byte;
PByteArray = ^TByteArray;
TByteArray = Array [0..1] of Byte;
PByteArray = ^TByteArray;
-
var
FILEHEADER: BITMAPFILEHEADER;
INFOHEADER: BITMAPINFOHEADER;
var
FILEHEADER: BITMAPFILEHEADER;
INFOHEADER: BITMAPINFOHEADER;
tmp: Byte;
i: Integer;
F: File of Byte;
tmp: Byte;
i: Integer;
F: File of Byte;
-
begin
begin
+ if e_NoGraphics then Exit;
+
if (Width mod 4) > 0 then
Width := Width + 4 - (Width mod 4);
if (Width mod 4) > 0 then
Width := Width + 4 - (Width mod 4);
biClrImportant := 0;
end;
biClrImportant := 0;
end;
+ //writeln('shot: ', FileName);
AssignFile(F, FileName);
Rewrite(F);
AssignFile(F, FileName);
Rewrite(F);
CloseFile(F);
FreeMem(pixels);
CloseFile(F);
FreeMem(pixels);
-end;}
+end;
function e_GetGamma(win: PSDL_Window): Byte;
var
function e_GetGamma(win: PSDL_Window): Byte;
var