forked from maisvendoo/DGLEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDGLEngine_header.pas
763 lines (688 loc) · 37.3 KB
/
DGLEngine_header.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
{------------------------------------------------------------------------------}
{ _____ _______ ________ _ _ ________ _ }
{ | __ \ | __ | | | | | | | / _____ \ | | }
{ | | \ \ | |__| | | ____ | | |\ | | | | |_| | | }
{ | | | | | ______| | | | | | |\\ | | | | | | }
{ | | | | | |\\ | | | | | | \\ | | | | ___ | | }
{ | | | | | | \\ | |____| | | | \\ | | | | |_ | | | _ }
{ | |_/ / | | \\ | | | | \\| | | |_____| | | |____| | }
{ |_____/ |_| \\ |________| |_| \|_| \________/ |________| }
{ }
{ DRON's OpenGl Engine V 1.0a http://dronprogs.mirgames.ru }
{ }
{ Date: 25.04.2006 }
{ }
{ Ëèöåíçèÿ: Âû ìîæåòå ñâîáîäíî èñïîëüçîâàòü ýòîò äâèæîê, êàê â êîììåð÷åñêèõ, }
{ òàê è íå êîììåð÷åñêèõ öåëÿõ, ïðè ñîáëþäåíèå îäíîãî óñëîâèÿ, â àâòîðàõ èãðû }
{ äîëæíî áûòü óêàçàíî, ÷òî èãðà èñïîëüçóåò DGLEngine è ïðèâåäåí àäðåñ ñàéòà, }
{ ëèáî îòîáðàæàòüñÿ ëîãîòèï äâèæêà ïðè ñòàðòå ïðîãðàììû. }
{  ïðîòèâíîì ñëó÷àå ýòî áóäåò ñ÷èòàòüñÿ íàðóøåíèåì àâòîðñêèõ ïðàâ. }
{ }
{------------------------------------------------------------------------------}
unit DGLEngine_header;
interface
uses Windows, Tlhelp32, Classes, SysUtils, Graphics, OpenGl;
function LoadDGLEngineDLL(FileName : string) : boolean;
procedure FreeDGLEngineDLL(EXE_FileName : string = '');
{***Engine***}
{Module version: 1.0}
{***Ïðîöåäóðû ðàáîòàþùèå òîëüêî äî ñòàðòà äâèæêà***}
const
//Ïàðàìåòðû ID
PROC_DRAW = $000000;
PROC_PROCESS = $000001;
PROC_INIT = $000002;
PROC_FREE = $000003;
var
RegProcedure : procedure (ID: WORD; ProcAdress: pointer); stdcall;
SetEngineInitParametrs : procedure (ResX,ResY,ColorDepth, DisplayFrequency : integer; Fullscreen, VSync, UseEngineSettingsIni : boolean; WriteLog : boolean = true); stdcall;
SetWindowPosition : procedure (Left, Top : integer); stdcall;
EnableStencilBuffer : procedure; stdcall;
SetEngineInifileName : procedure (Name : string); stdcall;
PleaseNoLogo : procedure; stdcall;
SetGameProcessInterval : procedure (Interval : byte); stdcall;
SetCutingPlanes : procedure (ZNear, ZFar : single); stdcall;
SetViewAngle : procedure (Angle : single); stdcall;
SetZBufferDepth : procedure (DepthBits : byte); stdcall;
{***}
StartEngine : procedure; stdcall;
QuitEngine : procedure; stdcall;
EngineVersion : function :shortstring; stdcall;
EngineProcessInterval : function : byte; stdcall;
StartEngine_DrawToPanel : procedure (PanelHandle : HWND); stdcall;
EngineProcessMessages : procedure (var Msg: tagMSG); stdcall;
EngineMainDraw : procedure; stdcall;
UpdateRenderRect : procedure (NewWidth,NewHeight : integer); stdcall;
LoadPlugin : function (FileName : string; DGLE_DLL_Handle : THandle) : string; stdcall;
IsPluginLoaded : function (Name : string) : boolean; stdcall;
GetPluginHandle : function (Name : string) : THandle; stdcall;
FreePlugin : procedure (Name : string); stdcall;
const
ENGINE_INIFILE = 'Settings.ini';
var
ReadValueFromIniFile : function (Filename, Section, Key: string):string; stdcall;
WriteValueToIniFile : procedure (Filename, Section, Key, Value : string); stdcall;
const
ENGINE_LOGFILE = 'DGLEngine_Log.txt';
var
AddToLogFile : procedure (FileName, LogStr:String; IsDate : Boolean = false; IsTime : Boolean = false; FileRewrite : boolean = false); stdcall;
ApplicationName : procedure (Name : PAnsiChar); stdcall;
PrintScreen : function (Folder : string = '') : integer; stdcall;
GetFPS : function : integer; stdcall;
GetScreenResX : function : integer; stdcall;
GetScreenResY : function : integer; stdcall;
AutoPause : procedure (Enable : boolean); stdcall;
MaxMultiTexturingLayers : function : byte; stdcall;
IsTexCompressionSupported : function : boolean; stdcall;
IsShadowMapsSupported : function : boolean; stdcall;
IsDOT3Supported : function : boolean; stdcall;
IsVShadersSupported : function : boolean; stdcall;
IsPShadersSupported : function : boolean; stdcall;
const
//Ïàðàìåòðû Quality
TEXDETAIL_BEST = $000000;
TEXDETAIL_MEDIUM = $000001;
TEXDETAIL_POOR = $000002;
//Ïàðàìåòðû TransparentColor
TRANSCOLOR_NONE = -$000001;
TRANSCOLOR_BLACK = $000000;
TRANSCOLOR_GRAY = $808080;
TRANSCOLOR_RED = $0000FF;
TRANSCOLOR_AQUA = $FFFF00;
TRANSCOLOR_FUSIA = $FF00FF;
var
LoadTexture : function (BMP : TBitmap; Quality : byte; TransparentColor : integer; ColorTolerance : byte; AlphaMask : TBitmap = nil) : Cardinal; stdcall;
LoadTGATexture : function (Filename : String; var Texture : Cardinal; Stream : TMemoryStream = nil) : Boolean; stdcall;
SetDefaultJPGTransparentColorTolerance : procedure (Tolerance : byte); stdcall;
LoadTextureFromPackage : function (FileName, Name : string; Quality : byte = TEXDETAIL_BEST; TransparentColor : integer = TRANSCOLOR_NONE) : Cardinal; stdcall;
LoadTextureFromFile : function (FileName: String; Quality : byte = TEXDETAIL_BEST; TransparentColor : integer = TRANSCOLOR_NONE) : Cardinal; stdcall;
FreeTexture : procedure (Texture : Cardinal); stdcall;
DrawTextureToTexture : procedure (TexSource,TexTarget : Cardinal; X,Y : integer); stdcall;
DrawTextureToTextureTransparentColor : procedure (TexSource, TexTarget : Cardinal; X,Y : integer; Color : Cardinal = $808080); stdcall;
TextureCompression : procedure (Enable : boolean); stdcall;
TextureMipMapping : procedure (Enable : boolean); stdcall;
TextureFiltering : procedure (Enable : boolean); stdcall;
const
//Ïàðàìåòðû Param
TEXTURE_REPEAT = $000000;
TEXTURE_CLAMP = $000001;
var
TextureParametrs : procedure (Texture : cardinal; Param : byte); stdcall;
const
//Âîçâðàùàåìûå ïàðàìåòðû TextureType
IS_TGA = $000001;
IS_RGBA = $000002;
IS_RGB = $000003;
IS_ALPHA = $000006;
IS_GEN = $000004;
IS_SHADOWMAP = $000005;
IS_UNLOAD = $000000;
//Âîçâðàùàåìûé ïàðàìåòð Index
INDEX_UNLOAD = $000000;
type TTextureInfo = record
Index : Cardinal;
Width,Height : integer;
Detail,
TextureType : byte;
end;
var
GetTextureInfo : function (Texture : Cardinal) : TTextureInfo; stdcall;
LoadFontFromFile : function (Filename : string) : Cardinal; stdcall;
FreeFont : procedure (Ident : cardinal); stdcall;
ExtractFromPackage : procedure (const PackageName, Name, DestFilename : string); stdcall;
LoadFromPackage : function (const Filename, Name : string):TMemoryStream; stdcall;
AddTimer : function (Interval : Cardinal; OnTimerProcedure : pointer) : Cardinal; stdcall;
DisableTimer : procedure (Ident : Cardinal); stdcall;
EnableTimer : procedure (Ident : Cardinal); stdcall;
SetTimerInterval : procedure (Ident, Interval : Cardinal); stdcall;
{***Console***}
{Module version: 1.0}
CreateConsole : procedure (Font : Cardinal; Size : real = 1.0; Texture : Cardinal = 0); stdcall;
RegisterCommandProcedure : procedure (ComName : string; ProcAdress : pointer); stdcall;
GetLastComParam : function : string; stdcall;
RegisterCommandValue : procedure (ComName : string; ValueAdress : pointer; MaxValue, MinValue : integer); stdcall;
AddStringToConsole : procedure (Text : string); stdcall;
ClearConsole : procedure; stdcall;
ProcessConsole : procedure; stdcall;
DrawConsole : procedure; stdcall;
{***Graphics 2D***}
{Module version: 1.0}
Begin2D : procedure; stdcall;
End2D : procedure; stdcall;
PutPoint2D : procedure (X,Y,Color : integer; Alpha : integer = 255) ; stdcall;
DrawLine2D : procedure (X1, Y1, X2, Y2, Color : integer; Alpha : integer = 255; LineWidth : real = 1.0; Smooth : boolean = false); stdcall;
DrawColorLine2D : procedure (X1, Y1, X2, Y2, Color1, Color2 : integer; Alpha : integer = 255; LineWidth : real = 1.0; Smooth : boolean = true); stdcall;
DrawRectangle2D : procedure (X, Y, Width, Height, Color : integer; Alpha : integer = 255; Fill : boolean = false); stdcall;
DrawRectangle2D_Fill_VertexColor : procedure (X, Y, Width, Height, Color1, Color2, Color3, Color4, Alpha1, Alpha2, Alpha3, Alpha4 : integer); stdcall;
DrawCircle2D : procedure (X, Y, Radius, Color : integer; Alpha : byte = 255); stdcall;
DrawCircle2D_Fill : procedure (X, Y, Radius, Color : integer; Alpha : byte = 255); stdcall;
DrawEllipse2D : procedure (Center: TPoint; Radius0, Radius1, Vertices: Integer; Color: Cardinal; Alpha: byte=255); stdcall;
DrawEllipse2D_Fill : procedure (Center: TPoint; Radius0, Radius1: Integer; Color: Cardinal; Alpha: byte=255); stdcall;
DrawCircleArc2D : procedure (X, Y, Radius, Angle1, Angle2, Color: Integer; Alpha : byte = 255); stdcall;
DrawPolygon2D : procedure (points : array of Tpoint; Color, Alpha : integer); stdcall;
type TColorVertex2D = record X,Y,Color, Alpha : integer; end;
var
DrawPolygon2D_VertexColor : procedure (points : array of TColorVertex2D); stdcall;
DrawTexture2D_Simple : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight : integer; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawTexture2D_Split : procedure (Texture : Cardinal; X , Y, TexWidth, TexHeight : integer; Angle, Alpha, Color : integer; SplitRect : Trect; Scale : single = 1.0; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawTexture2D : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight, Angle, Alpha, Color : integer; Diffuse : boolean = false; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawTexture2D_VertexColor : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight, Angle, Color1, Color2, Color3, Color4, Alpha1, Alpha2, Alpha3, Alpha4 : integer; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawSprite2D_Simple : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight,FramesXCount, FramesYCount, FrameNumber: integer; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawSprite2D : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight,FramesXCount, FramesYCount, FrameNumber, Angle, Alpha, Color : integer; Diffuse : boolean = false; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawSprite2D_VertexColor : procedure (Texture : Cardinal; X , Y, ImageWidth, ImageHeight,FramesXCount, FramesYCount, FrameNumber, Angle, Color1, Color2, Color3, Color4, Alpha1, Alpha2, Alpha3, Alpha4 : integer; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawSprite2D_Tile : procedure (Texture : Cardinal; X, Y, TexWidth, TexHeight, FrameWidth, FrameHeight, FramesXCount, FramesYCount, FrameNumber, Angle, Alpha, Color : integer; Scale : single = 1.0; FlipX : boolean = false; FlipY : boolean = false); stdcall;
DrawText2D : procedure (Font : Cardinal; X,Y : integer; Text : string; Color : integer = $FFFFFF; Alpha : integer = 255; Scale : real = 1.0); stdcall;
GetTextWidth : function (Font : Cardinal; Text : string; Scale : real = 1.0):integer; stdcall;
GetTextHeight : function (Font : Cardinal; Text : string; Scale : real = 1.0):integer; stdcall;
{***Graphics 3D***}
{Module version: 1.0}
BeginObj3D : procedure; stdcall;
EndObj3D : procedure; stdcall;
type
TVertex = record X, Y, Z: single; end;
TCamera = record
Eye : TVertex;
Center : TVertex;
end;
var
SetCamera : procedure (Camera : TCamera); stdcall;
Position3D : procedure (X,Y,Z : single); stdcall;
Scale3D : procedure (Scale : single); stdcall;
RotateX : procedure (Angle : single); stdcall;
RotateY : procedure (Angle : single); stdcall;
RotateZ : procedure (Angle : single); stdcall;
ResetMatrix : procedure; stdcall;
AdductingMatrix3Dto2D : procedure; stdcall;
ReturnStandartMatrix3D : procedure; stdcall;
Position2D : procedure (X,Y : integer); stdcall;
Color3D : procedure (Color:integer; Alpha : byte = 255; Diffuse : boolean= false; MaterialShininess : single = 0.0); stdcall;
const
TEX_BLANK = 0;
var
SetTexture : procedure (Texture : Cardinal); stdcall;
const
MTEX_LAYER0 = $000000;
MTEX_LAYER1 = $000001;
MTEX_LAYER2 = $000002;
MTEX_LAYER3 = $000003;
MTEX_LAYER4 = $000004;
MTEX_LAYER5 = $000005;
var
ActivateMultitexturingLayer : procedure (Layer : Cardinal); stdcall;
SetMultytexturingLayerOffset : procedure (Layer : cardinal; X,Y : single); stdcall;
SetMultytexturingLayerTexCoordMulti : procedure (Layer : cardinal; X,Y : single); stdcall;
DeactiveMultytexturing : procedure; stdcall;
CreateTextureToRenderIn : function (TextureWidth,TextureHeight : integer):Cardinal; stdcall;
StartRenderToTexture : procedure (Texture : Cardinal); stdcall;
EndRenderToTexture : procedure; stdcall;
const
//Ïàðàìåòðû ID
LIGHTS_ALL = -$000001;
LIGHT0 = $000000;
LIGHT1 = $000001;
LIGHT2 = $000002;
LIGHT3 = $000003;
LIGHT4 = $000004;
LIGHT5 = $000005;
LIGHT6 = $000006;
LIGHT7 = $000007;
LIGHT8 = $000008;
LIGHT9 = $000009;
//Ïàðàìåòð Radius
INFINITY = -$000001;
var
SetLight : procedure (ID : integer = LIGHT0; X : single = 1;Y : single = 0;Z : single = 1; light_Color : integer =$FFFFFF; Radius : single = INFINITY; Visualize : boolean = false; VisualScale : single = 0.1); stdcall;
DeactiveLight : procedure (ID : integer = LIGHTS_ALL); stdcall;
CreateFont3D : function (const Fontname : string):integer; stdcall;
Write3D : procedure (FontIdent: integer; Text: string); stdcall;
const
//Ïàðàìåòðû ScaleType
MDL_NO_SCALE = $000000;
MDL_SCALE_EVERY_FRAME = $000001;
MDL_SCALE_GL_ONE = $000002;
MDL_SCALE_BY_LARGEST_FRAME = $000003;
var
LoadModel : function (Filename : string; ScaleType : byte = MDL_SCALE_BY_LARGEST_FRAME) : integer; stdcall;
FreeModel : procedure (ModelIdent : integer); stdcall;
DrawModel : procedure (ModelIdent : integer; Frame : integer = 0; Smooth : boolean = true); stdcall;
ModelFramesCount : function (Modelident : integer):Integer; stdcall;
ModelBoundingBox : function (Modelident,Frame : integer):TVertex; stdcall;
ModelTrianglesCount : function (Modelident,Frame : integer) : Cardinal; stdcall;
EnableSphereMapping : procedure; stdcall;
DisableSphereMapping : procedure; stdcall;
SetFog : procedure (Color : Integer; Fog_Start, Fog_End : single); stdcall;
DeactiveFog : procedure; stdcall;
DrawAxes : procedure (Length : single = 1.0); stdcall;
DrawPoint : procedure (X,Y,Z : single); stdcall;
DrawLine : procedure (X,Y,Z,X1,Y1,Z1 : single; LineWidth : real = 1.0; Smooth : boolean = true); stdcall;
DrawPlane : procedure (Width,Height : single); stdcall;
type TVertex3D = record X,Y,Z : single; Color, Alpha : integer; TexX, TexY : single; end;
var
DrawPolygon3D : procedure (points : array of TVertex3D); stdcall;
DrawSprite : procedure (Width,Height : single; FramesXCount, FramesYCount, FrameNumber: integer);stdcall;
DrawSprite_BillBoard : procedure (Width,Height : single; FramesXCount, FramesYCount, FrameNumber: integer);stdcall;
DrawCube : procedure (Width,Height,Depth : single); stdcall;
DrawSphere : procedure (Radius : single); stdcall;
DrawCylinder : procedure (Radius,Height : single); stdcall;
DrawEllipse : procedure (Width, Height, Depth : single); stdcall;
{***Advanced 3D****}
{Module version: 1.0}
Get3DPos : function : TVertex; stdcall;
Get3DPosFree :function (pX,pY:integer): TVertex; stdcall;
Get2DPos : function (Vertex : TVertex) : TPoint; stdcall;
StartWriteToVideoMemory : function : cardinal; stdcall;
EndWriteToVideoMemory : procedure; stdcall;
FreeFromVideoMemory : procedure (Ident : integer); stdcall;
DrawFromVM : procedure (Ident : integer); stdcall;
CreateAVITexture : function (Filename : string) : integer; stdcall;
FreeAVITexture : procedure (index : integer); stdcall;
SetAviTexture : procedure (index : integer); stdcall;
ClearZBuffer : procedure; stdcall;
ZBuffer : procedure (Active : boolean); stdcall;
RenderProjection : procedure (ProjectTexture : cardinal; DrawScene : pointer; ProjectorOrientation: TCamera; InvertDiffuse : boolean = false); stdcall;
SetupProjector : procedure; stdcall;
DisableProjector : procedure; stdcall;
EndDrawingProjectedScene : procedure; stdcall;
RenderProjectedTexture : procedure (ProjectTexture : Cardinal; ProjectorOrientation: TCamera; InvertDiffuse : boolean = false); stdcall;
PrepareSceneForProjecting : procedure; stdcall;
SetShadowRenderAngle : procedure (Angle : cardinal); stdcall;
CreateShadowMap : function (Size : integer):Cardinal; stdcall;
CastShadowMap : procedure (Texture : Cardinal; LightCamera : TCamera); stdcall;
CalculateFrustum : procedure; stdcall;
IsPointInFrustum : function (X,Y,Z : single) : boolean; stdcall;
IsSphereInFrustum : function (X,Y,Z,Radius : single) : boolean; stdcall;
IsBoxInFrustum : function (X,Y,Z,W,H,D : single) : boolean; stdcall;
{***Network****}
{Module version: 1.0}
NET_Init : function : boolean; stdcall;
NET_Free : procedure; stdcall;
NET_Clear : procedure; stdcall;
NET_ClearAPL : procedure; stdcall;
NET_GetExternalIP : function : PChar; stdcall;
NET_GetHost : function : PChar; stdcall;
NET_GetLocalIP : function : PChar; stdcall;
NET_HostToIP : function (Host: PChar): PChar; stdcall;
NET_InitSocket : function (Port: WORD): integer; stdcall;
NET_Write : function (Buf: pointer; Count: integer): boolean; stdcall;
NET_Send : function (IP: PChar; Port: WORD; APL: boolean): integer; stdcall;
NET_Recv : function (Buf: pointer; Count: integer; var IP: PChar; var Port: integer; var RecvBytes: integer): integer; stdcall;
NET_Update : procedure; stdcall;
{***Sound****}
{Module version: 1.0}
PlayMusic : procedure (Filename : string; Looped : boolean = true); stdcall;
StopMusic : procedure; stdcall;
IsMusicPlaying : function : boolean; stdcall;
DirectSoundInit : procedure; stdcall;
LoadSample : function (Filename : string; FromPackage : boolean = false; Name : string = ''):integer; stdcall;
FreeSample : procedure (Index : integer); stdcall;
PlaySample : procedure (Index : integer); stdcall;
SetSampleVolume : procedure (Index : integer; Volume : byte); stdcall;
SetSample3DPosition : procedure (Index : integer; X,Y,Z : real); stdcall;
GetSample3DPosition : procedure (Index : integer; var X,Y,Z : single); stdcall;
{***Input***}
{Module version: 1.0}
const
MB_LEFT = $000001;
MB_MIDDLE = $000003;
MB_RIGHT = $000002;
MB_NONE = $000000;
var
GetMouseButtonPressed : function : byte; stdcall;
IsLeftMouseButtonPressed : function : boolean; stdcall;
IsRightMouseButtonPressed : function : boolean; stdcall;
GetMousePos : function : Tpoint; stdcall;
IsMouseMoveing : function : boolean; stdcall;
const
WHEEL_DOWN = -$000001;
WHEEL_UP = $000001;
WHEEL_NO_ACTION = $000000;
var
MouseWheelDelta : function : integer; stdcall;
StartKeyboardTextInput : procedure; stdcall;
EndKeyboardTextInput : procedure; stdcall;
GetKeyboardText : function : string; stdcall;
const
JOY_MAIN = $000000;
var
Input_JoyDown : function (JoyNum, Button: Byte): boolean; stdcall;
const
JOY_LEFT = $000001;
JOY_RIGHT= $000002;
JOY_UP = $000003;
JOY_DOWN = $000004;
var
Input_JoyDirections : function (JoyNum, Direction: Byte): boolean; stdcall;
IsKeyPressed : function (Key : integer) : boolean; stdcall;
//Key codes
const
Key_Escape = 27;
Key_Tab = 9;
Key_Backspace = 8;
Key_Space = 32;
Key_Enter = 13;
Key_Shift = 16;
Key_Control = 17;
Key_Alt = 18;
Key_F1 = 112;
Key_F2 = 113;
Key_F3 = 114;
Key_F4 = 115;
Key_F5 = 116;
Key_F6 = 117;
Key_F7 = 118;
Key_F8 = 119;
Key_F9 = 120;
Key_F10 = 121;
Key_F11 = 122;
Key_F12 = 123;
Key_Left = 37;
Key_Up = 38;
Key_Right = 39;
Key_Down = 40;
Key_0 = 48;
Key_1 = 49;
Key_2 = 50;
Key_3 = 51;
Key_4 = 52;
Key_5 = 53;
Key_6 = 54;
Key_7 = 55;
Key_8 = 56;
Key_9 = 57;
Key_A = 65;
Key_B = 66;
Key_C = 67;
Key_D = 68;
Key_E = 69;
Key_F = 70;
Key_G = 71;
Key_H = 72;
Key_I = 73;
Key_J = 74;
Key_K = 75;
Key_L = 76;
Key_M = 77;
Key_N = 78;
Key_O = 79;
Key_P = 80;
Key_Q = 81;
Key_R = 82;
Key_S = 83;
Key_T = 84;
Key_U = 85;
Key_V = 86;
Key_W = 87;
Key_X = 88;
Key_Y = 89;
Key_Z = 90;
var
RenderTexture2D : procedure (Texture : Cardinal; X, Y, FrameWidth, FrameHeight : integer; Color : integer; Alpha : byte; Angle : integer;
Frame : byte = 1; FrameCountX : byte = 1; FrameCountY : byte = 1; ScaleX : glFloat = 1.0; ScaleY : glFloat = 1.0;
Color4 : boolean = false; VColor1: integer = 0; VColor2: integer = 0; VColor3: integer = 0; VColor4: integer = 0; VAlpha1: integer = 0;
VAlpha2: integer = 0; VAlpha3: integer = 0; VAlpha4: integer = 0; Diffuse : boolean = false; FlipX : boolean = false; FlipY : boolean = false); stdcall;
WriteTextureInfo : procedure (Ind : cardinal; W,H : integer; Det, Typ : byte); stdcall;
CreateTexture : function (Width, Height, Format : Word; pData : Pointer) : Cardinal; stdcall;
_glTexCoord2f : procedure (X,Y : GLFloat); stdcall;
var
DGLEngineDLL_Handle : THandle;
procedure InitDGLE_1_0;
implementation
procedure InitDGLE_1_0;
begin
@Get3DPosFree:=GetProcAddress(DGLEngineDLL_Handle,'Get3DPosFree');
@AutoPause:=GetProcAddress(DGLEngineDLL_Handle,'AutoPause');
@SetDefaultJPGTransparentColorTolerance:=GetProcAddress(DGLEngineDLL_Handle,'SetDefaultJPGTransparentColorTolerance');
@MaxMultiTexturingLayers:=GetProcAddress(DGLEngineDLL_Handle,'MaxMultiTexturingLayers');
@IsShadowMapsSupported:=GetProcAddress(DGLEngineDLL_Handle,'IsShadowMapsSupported');
@IsDOT3Supported:=GetProcAddress(DGLEngineDLL_Handle,'IsDOT3Supported');
@IsVShadersSupported:=GetProcAddress(DGLEngineDLL_Handle,'IsVShadersSupported');
@IsPShadersSupported:=GetProcAddress(DGLEngineDLL_Handle,'IsPShadersSupported');
@FreePlugin:=GetProcAddress(DGLEngineDLL_Handle,'FreePlugin');
@GetPluginHandle:=GetProcAddress(DGLEngineDLL_Handle,'GetPluginHandle');
@IsPluginLoaded:=GetProcAddress(DGLEngineDLL_Handle,'IsPluginLoaded');
@LoadPlugin:=GetProcAddress(DGLEngineDLL_Handle,'LoadPlugin');
@StartEngine:=GetProcAddress(DGLEngineDLL_Handle,'StartEngine');
@RegProcedure:=GetProcAddress(DGLEngineDLL_Handle,'RegProcedure');
@TextureMipMapping:=GetProcAddress(DGLEngineDLL_Handle,'TextureMipMapping');
@TextureFiltering:=GetProcAddress(DGLEngineDLL_Handle,'TextureFiltering');
@TextureParametrs:=GetProcAddress(DGLEngineDLL_Handle,'TextureParametrs');
@AddToLogFile:=GetProcAddress(DGLEngineDLL_Handle,'AddToLogFile');
@TextureCompression:=GetProcAddress(DGLEngineDLL_Handle,'TextureCompression');
@EngineMainDraw:=GetProcAddress(DGLEngineDLL_Handle,'EngineMainDraw');
@EnableStencilBuffer:=GetProcAddress(DGLEngineDLL_Handle,'EnableStencilBuffer');
@UpdateRenderRect:=GetProcAddress(DGLEngineDLL_Handle,'UpdateRenderRect');
@StartEngine_DrawToPanel:=GetProcAddress(DGLEngineDLL_Handle,'StartEngine_DrawToPanel');
@EngineProcessMessages:=GetProcAddress(DGLEngineDLL_Handle,'EngineProcessMessages');
@ApplicationName:=GetProcAddress(DGLEngineDLL_Handle,'ApplicationName');
@GetFPS:=GetProcAddress(DGLEngineDLL_Handle,'GetFPS');
@LoadFontFromFile:=GetProcAddress(DGLEngineDLL_Handle,'LoadFontFromFile');
@SetWindowPosition:=GetProcAddress(DGLEngineDLL_Handle,'SetWindowPosition');
@QuitEngine:=GetProcAddress(DGLEngineDLL_Handle,'QuitEngine');
@PleaseNoLogo:=GetProcAddress(DGLEngineDLL_Handle,'PleaseNoLogo');
@SetGameProcessInterval:=GetProcAddress(DGLEngineDLL_Handle,'SetGameProcessInterval');
@ExtractFromPackage:=GetProcAddress(DGLEngineDLL_Handle,'ExtractFromPackage');
@FreeTexture:=GetProcAddress(DGLEngineDLL_Handle,'FreeTexture');
@LoadTexture:=GetProcAddress(DGLEngineDLL_Handle,'LoadTexture');
@LoadTGATexture:=GetProcAddress(DGLEngineDLL_Handle,'LoadTGATexture');
@LoadTextureFromPackage:=GetProcAddress(DGLEngineDLL_Handle,'LoadTextureFromPackage');
@LoadTextureFromFile:=GetProcAddress(DGLEngineDLL_Handle,'LoadTextureFromFile');
@SetEngineInitParametrs:=GetProcAddress(DGLEngineDLL_Handle,'SetEngineInitParametrs');
@ReadValueFromIniFile:=GetProcAddress(DGLEngineDLL_Handle,'ReadValueFromIniFile');
@WriteValueToIniFile:=GetProcAddress(DGLEngineDLL_Handle,'WriteValueToIniFile');
@SetEngineInifileName:=GetProcAddress(DGLEngineDLL_Handle,'SetEngineInifileName');
@PrintScreen:=GetProcAddress(DGLEngineDLL_Handle,'PrintScreen');
@GetScreenResX:=GetProcAddress(DGLEngineDLL_Handle,'GetScreenResX');
@GetScreenResY:=GetProcAddress(DGLEngineDLL_Handle,'GetScreenResY');
@SetCutingPlanes:=GetProcAddress(DGLEngineDLL_Handle,'SetCutingPlanes');
@SetViewAngle:=GetProcAddress(DGLEngineDLL_Handle,'SetViewAngle');
@ClearZBuffer:=GetProcAddress(DGLEngineDLL_Handle,'ClearZBuffer');
@SetZBufferDepth:=GetProcAddress(DGLEngineDLL_Handle,'SetZBufferDepth');
@LoadFromPackage:=GetProcAddress(DGLEngineDLL_Handle,'LoadFromPackage');
@GetTextureInfo:=GetProcAddress(DGLEngineDLL_Handle,'GetTextureInfo');
@AddTimer:=GetProcAddress(DGLEngineDLL_Handle,'AddTimer');
@EnableTimer:=GetProcAddress(DGLEngineDLL_Handle,'EnableTimer');
@DisableTimer:=GetProcAddress(DGLEngineDLL_Handle,'DisableTimer');
@SetTimerInterval:=GetProcAddress(DGLEngineDLL_Handle,'SetTimerInterval');
@FreeFont:=GetProcAddress(DGLEngineDLL_Handle,'FreeFont');
@AddStringToConsole:=GetProcAddress(DGLEngineDLL_Handle,'AddStringToConsole');
@RegisterCommandProcedure:=GetProcAddress(DGLEngineDLL_Handle,'RegisterCommandProcedure');
@CreateConsole:=GetProcAddress(DGLEngineDLL_Handle,'CreateConsole');
@RegisterCommandValue:=GetProcAddress(DGLEngineDLL_Handle,'RegisterCommandValue');
@ProcessConsole:=GetProcAddress(DGLEngineDLL_Handle,'ProcessConsole');
@DrawConsole:=GetProcAddress(DGLEngineDLL_Handle,'DrawConsole');
@ClearConsole:=GetProcAddress(DGLEngineDLL_Handle,'ClearConsole');
@GetLastComParam:=GetProcAddress(DGLEngineDLL_Handle,'GetLastComParam');
@Begin2D:=GetProcAddress(DGLEngineDLL_Handle,'Begin2D');
@End2D:=GetProcAddress(DGLEngineDLL_Handle,'End2D');
@DrawTexture2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawTexture2D');
@GetTextHeight:=GetProcAddress(DGLEngineDLL_Handle,'GetTextHeight');
@DrawTexture2D_Simple:=GetProcAddress(DGLEngineDLL_Handle,'DrawTexture2D_Simple');
@DrawTexture2D_VertexColor:=GetProcAddress(DGLEngineDLL_Handle,'DrawTexture2D_VertexColor');
@DrawSprite2D_Simple:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite2D_Simple');
@DrawSprite2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite2D');
@DrawSprite2D_VertexColor:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite2D_VertexColor');
@PutPoint2D:=GetProcAddress(DGLEngineDLL_Handle,'PutPoint2D');
@DrawLine2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawLine2D');
@DrawRectangle2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawRectangle2D');
@DrawRectangle2D_Fill_VertexColor:=GetProcAddress(DGLEngineDLL_Handle,'DrawRectangle2D_Fill_VertexColor');
@DrawCircle2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawCircle2D');
@DrawEllipse2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawEllipse2D');
@DrawText2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawText2D');
@GetTextWidth:=GetProcAddress(DGLEngineDLL_Handle,'GetTextWidth');
@DrawCircle2D_Fill:=GetProcAddress(DGLEngineDLL_Handle,'DrawCircle2D_Fill');
@DrawCircleArc2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawCircleArc2D');
@DrawColorLine2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawColorLine2D');
@DrawTexture2D_Split:=GetProcAddress(DGLEngineDLL_Handle,'DrawTexture2D_Split');
@DrawPolygon2D:=GetProcAddress(DGLEngineDLL_Handle,'DrawPolygon2D');
@DrawSprite2D_Tile:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite2D_Tile');
@DrawEllipse2D_Fill:=GetProcAddress(DGLEngineDLL_Handle,'DrawEllipse2D_Fill');
@DrawPolygon2D_VertexColor:=GetProcAddress(DGLEngineDLL_Handle,'DrawPolygon2D_VertexColor');
@BeginObj3D:=GetProcAddress(DGLEngineDLL_Handle,'BeginObj3D');
@EndObj3D:=GetProcAddress(DGLEngineDLL_Handle,'EndObj3D');
@Position3D:=GetProcAddress(DGLEngineDLL_Handle,'Position3D');
@Color3D:=GetProcAddress(DGLEngineDLL_Handle,'Color3D');
@SetShadowRenderAngle:=GetProcAddress(DGLEngineDLL_Handle,'SetShadowRenderAngle');
@ModelTrianglesCount:=GetProcAddress(DGLEngineDLL_Handle,'ModelTrianglesCount');
@AdductingMatrix3Dto2D:=GetProcAddress(DGLEngineDLL_Handle,'AdductingMatrix3Dto2D');
@ReturnStandartMatrix3D:=GetProcAddress(DGLEngineDLL_Handle,'ReturnStandartMatrix3D');
@DrawAxes:=GetProcAddress(DGLEngineDLL_Handle,'DrawAxes');
@RotateX:=GetProcAddress(DGLEngineDLL_Handle,'RotateX');
@RotateY:=GetProcAddress(DGLEngineDLL_Handle,'RotateY');
@RotateZ:=GetProcAddress(DGLEngineDLL_Handle,'RotateZ');
@SetTexture:=GetProcAddress(DGLEngineDLL_Handle,'SetTexture');
@Position2D:=GetProcAddress(DGLEngineDLL_Handle,'Position2D');
@DrawPlane:=GetProcAddress(DGLEngineDLL_Handle,'DrawPlane');
@DrawSphere:=GetProcAddress(DGLEngineDLL_Handle,'DrawSphere');
@DrawCube:=GetProcAddress(DGLEngineDLL_Handle,'DrawCube');
@DrawLine:=GetProcAddress(DGLEngineDLL_Handle,'DrawLine');
@Drawpoint:=GetProcAddress(DGLEngineDLL_Handle,'Drawpoint');
@DrawCylinder:=GetProcAddress(DGLEngineDLL_Handle,'DrawCylinder');
@CreateFont3D:=GetProcAddress(DGLEngineDLL_Handle,'CreateFont3D');
@Write3D:=GetProcAddress(DGLEngineDLL_Handle,'Write3D');
@LoadModel:=GetProcAddress(DGLEngineDLL_Handle,'LoadModel');
@FreeModel:=GetProcAddress(DGLEngineDLL_Handle,'FreeModel');
@DrawModel:=GetProcAddress(DGLEngineDLL_Handle,'DrawModel');
@ModelFramesCount:=GetProcAddress(DGLEngineDLL_Handle,'ModelFramesCount');
@Scale3D:=GetProcAddress(DGLEngineDLL_Handle,'Scale3D');
@EnableSphereMapping:=GetProcAddress(DGLEngineDLL_Handle,'EnableSphereMapping');
@DisableSphereMapping:=GetProcAddress(DGLEngineDLL_Handle,'DisableSphereMapping');
@SetLight:=GetProcAddress(DGLEngineDLL_Handle,'SetLight');
@DrawEllipse:=GetProcAddress(DGLEngineDLL_Handle,'DrawEllipse');
@StartRenderToTexture:=GetProcAddress(DGLEngineDLL_Handle,'StartRenderToTexture');
@EndRenderToTexture:=GetProcAddress(DGLEngineDLL_Handle,'EndRenderToTexture');
@CreateTextureToRenderIn:=GetProcAddress(DGLEngineDLL_Handle,'CreateTextureToRenderIn');
@SetFog:=GetProcAddress(DGLEngineDLL_Handle,'SetFog');
@DeactiveFog:=GetProcAddress(DGLEngineDLL_Handle,'DeactiveFog');
@StartWriteToVideoMemory:=GetProcAddress(DGLEngineDLL_Handle,'StartWriteToVideoMemory');
@EndWriteToVideoMemory:=GetProcAddress(DGLEngineDLL_Handle,'EndWriteToVideoMemory');
@FreeFromVideoMemory:=GetProcAddress(DGLEngineDLL_Handle,'FreeFromVideoMemory');
@DrawFromVM:=GetProcAddress(DGLEngineDLL_Handle,'DrawFromVM');
@DrawSprite:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite');
@DrawTextureToTexture:=GetProcAddress(DGLEngineDLL_Handle,'DrawTextureToTexture');
@SetMultytexturingLayerTexCoordMulti:=GetProcAddress(DGLEngineDLL_Handle,'SetMultytexturingLayerTexCoordMulti');
@DrawPolygon3D:=GetProcAddress(DGLEngineDLL_Handle,'DrawPolygon3D');
@CreateAVITexture:=GetProcAddress(DGLEngineDLL_Handle,'CreateAVITexture');
@FreeAVITexture:=GetProcAddress(DGLEngineDLL_Handle,'FreeAVITexture');
@SetAviTexture:=GetProcAddress(DGLEngineDLL_Handle,'SetAviTexture');
@SetCamera:=GetProcAddress(DGLEngineDLL_Handle,'SetCamera');
@DeactiveLight:=GetProcAddress(DGLEngineDLL_Handle,'DeactiveLight');
@ModelBoundingBox:=GetProcAddress(DGLEngineDLL_Handle,'ModelBoundingBox');
@SetupProjector:=GetProcAddress(DGLEngineDLL_Handle,'SetupProjector');
@DisableProjector:=GetProcAddress(DGLEngineDLL_Handle,'DisableProjector');
@RenderProjection:=GetProcAddress(DGLEngineDLL_Handle,'RenderProjection');
@RenderProjectedTexture:=GetProcAddress(DGLEngineDLL_Handle,'RenderProjectedTexture');
@PrepareSceneForProjecting:=GetProcAddress(DGLEngineDLL_Handle,'PrepareSceneForProjecting');
@EndDrawingProjectedScene:=GetProcAddress(DGLEngineDLL_Handle,'EndDrawingProjectedScene');
@Get3DPos:=GetProcAddress(DGLEngineDLL_Handle,'Get3DPos');
@Get2DPos:=GetProcAddress(DGLEngineDLL_Handle,'Get2DPos');
@CalculateFrustum:=GetProcAddress(DGLEngineDLL_Handle,'CalculateFrustum');
@IsPointInFrustum:=GetProcAddress(DGLEngineDLL_Handle,'IsPointInFrustum');
@IsSphereInFrustum:=GetProcAddress(DGLEngineDLL_Handle,'IsSphereInFrustum');
@IsBoxInFrustum:=GetProcAddress(DGLEngineDLL_Handle,'IsBoxInFrustum');
@DrawSprite_BillBoard:=GetProcAddress(DGLEngineDLL_Handle,'DrawSprite_BillBoard');
@CreateShadowMap:=GetProcAddress(DGLEngineDLL_Handle,'CreateShadowMap');
@CastShadowMap:=GetProcAddress(DGLEngineDLL_Handle,'CastShadowMap');
@ActivateMultitexturingLayer:=GetProcAddress(DGLEngineDLL_Handle,'ActivateMultitexturingLayer');
@DeactiveMultytexturing:=GetProcAddress(DGLEngineDLL_Handle,'DeactiveMultytexturing');
@SetMultytexturingLayerOffset:=GetProcAddress(DGLEngineDLL_Handle,'SetMultytexturingLayerOffset');
@DrawTextureToTextureTransparentColor:=GetProcAddress(DGLEngineDLL_Handle,'DrawTextureToTextureTransparentColor');
@ZBuffer:=GetProcAddress(DGLEngineDLL_Handle,'ZBuffer');
@ResetMatrix:=GetProcAddress(DGLEngineDLL_Handle,'ResetMatrix');
@DirectSoundInit:=GetProcAddress(DGLEngineDLL_Handle,'DirectSoundInit');
@LoadSample:=GetProcAddress(DGLEngineDLL_Handle,'LoadSample');
@FreeSample:=GetProcAddress(DGLEngineDLL_Handle,'FreeSample');
@PlaySample:=GetProcAddress(DGLEngineDLL_Handle,'PlaySample');
@SetSampleVolume:=GetProcAddress(DGLEngineDLL_Handle,'SetSampleVolume');
@PlayMusic:=GetProcAddress(DGLEngineDLL_Handle,'PlayMusic');
@StopMusic:=GetProcAddress(DGLEngineDLL_Handle,'StopMusic');
@SetSample3DPosition:=GetProcAddress(DGLEngineDLL_Handle,'SetSample3DPosition');
@IsMusicPlaying:=GetProcAddress(DGLEngineDLL_Handle,'IsMusicPlaying');
@GetSample3DPosition:=GetProcAddress(DGLEngineDLL_Handle,'GetSample3DPosition');
@GetMousePos:=GetProcAddress(DGLEngineDLL_Handle,'GetMousePos');
@GetMouseButtonPressed:=GetProcAddress(DGLEngineDLL_Handle,'GetMouseButtonPressed');
@IsKeyPressed:=GetProcAddress(DGLEngineDLL_Handle,'IsKeyPressed');
@StartKeyboardTextInput:=GetProcAddress(DGLEngineDLL_Handle,'StartKeyboardTextInput');
@EndKeyboardTextInput:=GetProcAddress(DGLEngineDLL_Handle,'EndKeyboardTextInput');
@GetKeyboardText:=GetProcAddress(DGLEngineDLL_Handle,'GetKeyboardText');
@IsMouseMoveing:=GetProcAddress(DGLEngineDLL_Handle,'IsMouseMoveing');
@MouseWheelDelta:=GetProcAddress(DGLEngineDLL_Handle,'MouseWheelDelta');
@Input_JoyDown:=GetProcAddress(DGLEngineDLL_Handle,'Input_JoyDown');
@Input_JoyDirections:=GetProcAddress(DGLEngineDLL_Handle,'Input_JoyDirections');
@IsRightMouseButtonPressed:=GetProcAddress(DGLEngineDLL_Handle,'IsRightMouseButtonPressed');
@IsLeftMouseButtonPressed:=GetProcAddress(DGLEngineDLL_Handle,'IsLeftMouseButtonPressed');
@NET_Init:=GetProcAddress(DGLEngineDLL_Handle,'NET_Init');
@NET_Free:=GetProcAddress(DGLEngineDLL_Handle,'NET_Free');
@NET_Clear:=GetProcAddress(DGLEngineDLL_Handle,'NET_Clear');
@NET_ClearAPL:=GetProcAddress(DGLEngineDLL_Handle,'NET_ClearAPL');
@NET_GetExternalIP:=GetProcAddress(DGLEngineDLL_Handle,'NET_GetExternalIP');
@NET_GetHost:=GetProcAddress(DGLEngineDLL_Handle,'NET_GetHost');
@NET_GetLocalIP:=GetProcAddress(DGLEngineDLL_Handle,'NET_GetLocalIP');
@NET_HostToIP:=GetProcAddress(DGLEngineDLL_Handle,'NET_HostToIP');
@NET_InitSocket:=GetProcAddress(DGLEngineDLL_Handle,'NET_InitSocket');
@NET_Write:=GetProcAddress(DGLEngineDLL_Handle,'NET_Write');
@NET_Send:=GetProcAddress(DGLEngineDLL_Handle,'NET_Send');
@NET_Recv:=GetProcAddress(DGLEngineDLL_Handle,'NET_Recv');
@NET_Update:=GetProcAddress(DGLEngineDLL_Handle,'NET_Update');
@RenderTexture2D:=GetProcAddress(DGLEngineDLL_Handle,'RenderTexture2D');
@WriteTextureInfo:=GetProcAddress(DGLEngineDLL_Handle,'WriteTextureInfo');
@CreateTexture:=GetProcAddress(DGLEngineDLL_Handle,'CreateTexture');
@_glTexCoord2f:=GetProcAddress(DGLEngineDLL_Handle,'_glTexCoord2f');
@IsTexCompressionSupported:=GetProcAddress(DGLEngineDLL_Handle,'IsTexCompressionSupported');
end;
function LoadDGLEngineDLL(FileName : string) : boolean;
var
DLL_ver : function : byte; stdcall;
begin
result:=false;
if not FileExists(FileName) then
begin
MessageBox(0, PChar('DGLEngine DLL ("'+ Filename +'") not found!'), 'DGLEngine header', MB_OK or MB_ICONERROR);
Exit;
end;
DGLEngineDLL_Handle:=LoadLibrary(PChar(Filename));
if DGLEngineDLL_Handle=0 then
begin
MessageBox(0, 'Couldn''t load DGLEngine DLL for unknown reason!', 'DGLEngine header', MB_OK or MB_ICONERROR);
Exit;
end;
@DLL_ver:=GetProcAddress(DGLEngineDLL_Handle,'DLL_ver');
if @DLL_ver=nil then
begin
MessageBox(0, 'Corrupted DGLEngine DLL!', 'DGLEngine header', MB_OK or MB_ICONERROR);
Exit;
end;
if DLL_ver>=1 then InitDGLE_1_0;
result:=true;
end;
procedure FreeDGLEngineDLL(EXE_FileName : string = '');
function KillTask(ExeFileName: string): integer;
const
PROCESS_TERMINATE=$0001;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
result := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle,FProcessEntry32);
while integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile))=UpperCase(ExeFileName))
or (UpperCase(FProcessEntry32.szExeFile)=UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess(OpenProcess(PROCESS_TERMINATE, BOOL(0),FProcessEntry32.th32ProcessID), 0));
ContinueLoop := Process32Next(FSnapshotHandle,FProcessEntry32);
end;
end;
begin
if EXE_FileName<>'' then
if KillTask(EXE_FileName)=0 then
MessageBox(0, PChar('Couldn''t find process "'+EXE_FileName+'"!'),'DGLEngine header', MB_OK or MB_ICONERROR);
if not FreeLibrary(DGLEngineDLL_Handle) then
begin
DGLEngineDLL_Handle:=0;
MessageBox(0, 'Couldn''t free DGLEngine DLL!', 'DGLEngine header', MB_OK or MB_ICONERROR);
end;
end;
end.