Re: Tapu's 3D engine
- Posted by Todd Riggins <triggins at AIRMAIL.NET> Jul 15, 1999
- 526 views
Talvitie wrote: > Anyway, give me some feedback and read that .txt file before running. Good job.. :) I got 8 fps for the 640x480 8bit mode and 3 fps for the 1024x768 24/32bit mode. > DirectX interests me, so how are you doing with Exotica and it's > documentation Todd? Curious, did all the examples work fine for you? When I ever get Direct3D implemented into Exotica, it should be possible for you to use your own 3D engine to do the math in euphoria. I just don't know how easy/hard it will be to convert your 3D engine to use DirectX/Direct3D quite yet if you are interested in that. I been trying to tweak some of my code, finished the cd audio functions, added wave streaming and MIDI support. I need to add more control of DirectSound for the users... and try to finish up me API docs... also, I need to make a demo to introduce Exotica which will include a simple game in it. Plus, I need to make an example how to do mem_copy to do graphics. With the help of Mark(aka Liquid Nitrogen), I see that most of the Euphoria programs I've seen uses mem_copy to transfer a whole block of memory to display graphics in DOS. It's possible to do this on a DirectX surface, but then it will either show what you want on some video cards and show complete garbage on other video cards. To avoid garbage, DirectX uses a 'pitch' variable to know the exact width to use according to the video card so your graphics will always be right on all video cards. So an 'in-theory' mem_copy method for euphoria to draw on a DirectX surface might be: for y = 0 to height do mem_copy (dst_ptr + y * dst_pitch, src_ptr + y, bytestocopy) end for the 'bytestocopy' is the width of the graphic. I don't know how much of a performance lost that would be, but that "in theory" is the only way to be sure of a correct mem_copy'd graphic blitting to the surface on all video cards. But, "as a suggestion", with Windows/DirectX programming, storing your bitmap into video memory and using the DirectX Blt/Bltfast functions to blit that graphic to the surface which is also stored in video memory will have the fastest performance than doing the Win32's memcpy method. With these functions, DirectX also takes advantage of any 2D acceleration your card may have and DirectX uses the MMX if your cpu has this. I think DirectX 7.0 will have 3DNOW support, I'm not sure of that yet. Ofcoarse, when I get the Direct3D stuff done, DirectX will use any 3D acceleration it can support. Anywayz, you will still have any options to your own choosing on how you want to blit gfx to a DirectX surface. Even though my lib 'Wraps' the DirectX functions, I am trying to make it that the programmers that uses Exotica have complete control on how DirectX operates without haveing to code in the lame stuff. I don't want Exotica to confine the programmer on "this the only way you can do it with my lib" type of thing. Ofcoarse, I still have some work to do to achive that, specially programming in euphoria with Exotica since I'm rather new to Euphoria. Future feedback from Exotica users will help me make Exotica easier to program with, hopefully. Todd Riggins -------------------------------- Want to know more about Exotica? http://www.50megs.com/exotica/