SDL Texturing
I’ve completed another simple component which will be used in the development of my SDL.Net game. While loading and rendering textures is not exactly a complex task, especially with the advantages that .Net provides for the loading of image data, it is none-the-less an important aspect to any application that uses 3d rendering.
Heres a screenshot of the latest running.
Get the Source code : http://cc.borland.com/item.aspx?id=23959
The new file is TextureMap.pas, and it includes the following things. The singleton class TextureResource, which loads and manages textures in an instance of any Delphi.Net application. The function DrawTexturedQuad which will draw a quad on the screen with the given texture, and also draw it either masked or unmasked.
A quick overview of how the TextureResource class works. It has only two public functions: get() which retreives the singleton instance, and Texture(String) which retreives the OpenGl ID of the texture. TextureResource stored loaded textures into a hashtable to prevent loading any texture file twice. The first time Texture is called on an unloaded image the texture is loaded and cached. Texture will also generate a masked textured for any file by prepending the filename with MASK.
Take a look into the TextureMap.pas file if your interested. The specifics of loading the image data and generating the textures are fairly well explained in comments in the code.
Also youll notice that in the test code I have a file called GUICore.pas. This is some beta code for doing basic in game gui stuff like button, panels, and windows. Feel free to check out that code too, but its pretty rough and uncommented at this point.
I’ve got some more work to do on the basic GUI stuff, then perhaps Ill be able to get started on some actual game logic work.
Share This | Email this page to a friend
Posted by David Lock on March 29th, 2006 under Uncategorized |

RSS Feed

March 30th, 2006 at 8:04 pm
I used this program i feel they used from SDL for presentation because in their advertisement they told that THESE SOFTWARE IS 100 by Delphi!!!
also i used this program and it is amazing, i like it so much (i was beta tester) ,,, see pictures, i used that chess sample (they told this program is a super messenger)
also i saw this link is Steve’s weblog.
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//1.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//2.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//3.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//4.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//5.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//6.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//7.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//8.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//9.jpg
http://212.227.49.87:84//ADMIN/SAMPLEOFPICTURES//10.jpg
April 18th, 2006 at 3:55 pm
David, Interesting little project.
I wanted to try it out myself and spent several hours trying to figure out what I needed to download and install to get it running. For other people who would like to try this sample and David’s previous one, here is one way to get it running.
1) Download David’s Source code. (Link above)
2) Go to http://sourceforge.net/project/showfiles.php?group_id=52340 and follow the download link.
3) Download the SDL.NET Runtime_Setup.exe and the SDL.NET SDK_Setup.exe. (The Runtime setup was not sufficient to run the program, the SDK setup may be sufficient but I didn’t test that. I also downloaded the Zip to see the contents)
4) Install the SDL.NET Runtime_Setup
5) Install the SDL.NET SDK_Setup
6) Create a directory for David’s Source and extract his code.
7) Open BDS (I am using BDS2005), go to [Components]/[Install .Net Components]/[Assembly Search Paths]. I found that the install had added C:\Program Files\SdlDotNet\runtime\bin (directory where runtime was installed). I added C:\Program Files\SdlDotNet\sdk\lib (directory where the SDK was installed).
David’s first program (See his blog "What is SDL.NET") worked fine in BDS2005 but I got 2 compile errors for this version of the program. BDS2005 did not like the rect.create(… syntax, had to change it to rect := Rectangle.create(…
Second problem in BDS2005 was the graphics in the button and in the upper right corner displayed as empty white boxes. And third, I could not close the program by closing the window. Going to explore these issues further.
I hope this helps other people that want to try this sample out.
David Plock [not to be confused with David Lock
]