#### Archived

This topic is now archived and is closed to further replies.

# Voxel turorial

## Recommended Posts

I''m writing a 3D engine, non DX or GL, in Delphi. Anyone knows where I can get a god tutorial about a free view voxel landscape rendering???

##### Share on other sites

Well, search for "sergei savchenko" and "voxel" with google or so,
he wrote some really good docs on 3d graphics programming, and
coded a voxel engine.

BUT: I suppose that won''t work with Delphi. (the code samples are in C/C++ anyway)
I''ve been working with Delphi for some time, and what I know is,
that Delphi only works event driven, in other words it''s not capable
of doing realtime programs, unless you have OpenGL for Delphi.
Or do you know a way to get free access to vram in Delphi, like in DX?
(there is no DX for Delphi, is it?)

If I am right, and there is no way to get Delphi-progs running
"free", without having to press buttons all the time to get anything
to happen, I suggest you chose another Programming Language/Development
software.

##### Share on other sites
quote:
Original post by Anonymous Poster
I''ve been working with Delphi for some time, and what I know is,
that Delphi only works event driven, in other words it''s not capable of doing realtime programs, unless you have OpenGL for Delphi.

Nonsense. Delphi comes with a graphical interface just like the one that comes with C++ Builder. That however, does not prevent you from writing "pure" Object Pascal code. People who are not afraid of using the Win32 API directly can just call it.
In fact, you don''t need to use the units/libraries included with Delphi. To declare a Win32 function you just do something like:

procedure somewin32function(a, b : integer); stdcall; external ''somefile.dll'';

quote:

(there is no DX for Delphi, is it?)

Both DirectX, OpenGL, PTC, SDL and even Glide are avaiable for Delphi.

quote:

If I am right, and there is no way to get Delphi-progs running
"free", without having to press buttons all the time to get anything to happen

You''re not. Try saving the following code to a something.dpr and compile it with Delphi.

program Project1;uses  Windows; // not really neededconst  WM_LBUTTONDOWN = 513;  WM_DESTROY     = 2;var  a : TWNDCLASS; b : HWND; c: TMSG;function zzz(w : HWND; x : UINT; y : WPARAM; z : LPARAM) : longint; stdcall;begin  if x = WM_LBUTTONDOWN then    MessageBox(0,''end'',''end'',0);  if x = WM_DESTROY then    PostQuitMessage(0);  zzz:=DefWindowProc(w,x,y,z);end;function WinMain(i, j : integer; k : PChar; l : integer) : integer;begin  a.lpszClassName:=''a1'';  a.hInstance:=i;  a.lpfnWndProc:=@zzz;  a.hbrBackground:=GetStockObject(WHITE_BRUSH);  RegisterClass(a);  b:=CreateWindow(''a1'',''Windows framework'',WS_OVERLAPPEDWINDOW,1,1,10,20,0,0,i,nil);  ShowWindow(b, 3);  while GetMessage(c, 0, 0, 0) do    DispatchMessage(c);end;begin  WinMain( hInstance, hPrevInst, CmdLine, CmdShow );end.

quote:

I suggest you chose another Programming Language/Development software.

I see no reason for him to do that. Object Pascal (the Deplhi language) is a powerful language.

##### Share on other sites
Well, ok, I used delphi only at school.
I had soon moved to C++, and I think it''s much
"clearer" , or more logic than pascal, if you don''t know what I mean,
well, no time for further explanation at the moment,
I suppose u don''t care anyway, I just like it better,
and, it is powerful, well, unlike pascal, it''s been created to
be effective from its "childhood" on.
Pascal''s concept is different, and the oop stuff has

AND most of code samples available are rather in c/c++
than pascal.

• ### Forum Statistics

• Total Topics
628378
• Total Posts
2982347

• 10
• 9
• 15
• 24
• 11