Так как я практически не знаю Delphi, элемент писался методом научного тыка, кучи проб и ещё больших куч ошибок... и ... В итоге Debugger пишет :
Borland Delphi Version 12.0 Copyright (c) 1983,98 Inprise Corporation
[color=#CC3300]C:\Program Files (x86)\HiASM\Elements\delphi\code\hi2DPerspective.pas(27) Error: Types of actual and formal var parameters must be identical
C:\Program Files (x86)\HiASM\Elements\delphi\code\hi2DPerspective.pas(28) Error: Types of actual and formal var parameters must be identical
C:\Program Files (x86)\HiASM\Elements\delphi\code\hiMainForm_35D4000.pas(8) Fatal: Could not compile used unit 'hi2DPerspective.pas'[/color]
unit hi2DPerspective;
interface
uses Windows,kol,Share,Debug,OpenGL;
type
THI2DPerspective = class(TDebug)
private
public
_event_onPerspective2D:THI_Event;
_prop_Width:real;
_prop_Height:real;
_data_Width:THI_Event;
_data_Height:THI_Event;
procedure _work_doPerspective2D(var Data:TData; index:word);
end;
implementation
procedure THI2DPerspective._work_doPerspective2D(var Data:TData; index:word);
var
wi,he:integer;
begin
wi := readdata(_data_Width);//WHY ERROR?
he := readdata(_data_Height);//WHY????????????????????????????????????
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
glOrtho ( 0, wi, he, 0, -1, 1);//set perspective
glMatrixMode(GL_MODELVIEW);
_hi_OnEvent(_event_onPerspective2D);
end;
end.
Редактировалось 4 раз(а), последний 2020-03-29 20:51:23