Porting a QBasic raycaster to Windows (DirectX)

Started by
1 comment, last by Lode 21 years, 11 months ago
Hello, more than a year ago, I made a 3D raycasting engine in QBasic, and then I compiled with FirstBasic so it's much faster. Here's an animated screenshot of the thing: [img]http://www.perilith.com/~lode/tutorials/neowolf.gif[/img] I hope [img] code works, if not just go to here: http://www.perilith.com/~lode/tutorials/neowolf.gif As you can see it doesn't support texture mapping and has some glitches, but it DOES support real time lighting BTW by raycaster I do NOT mean the lighting only, but the complete engine works like old raycasters such as Wolf3D, only with a 3D array for the world instead of a 2D one. Anyway, I would like to port it to Windows, using DevC++. Problem is, for a raycaster like this, I need to draw each pixel individually. I've done a lot of research and experimentation already, but I'm getting nowhere. The few attempts that actually drew a pixel with DirectX, where so slow that just painting a rectangle pixel by pixel took a more than a minute, and this while games do 100FPS at 1024*768 = 78643200pixels/sec. Actually, drawing ONE pixel took longer than doing all the goniometric calculations and the casting of the ray for one pixel. I've already heard things like locking a surface and doing putpixel and such, but also that these methods are very slow. Then I heard it's possible to calculate all pixels first and draw them all at once after that, but I've no idea how to do that. So could someone please help me: how should I make a fast raycaster for windows? Does there exist an open source fast pixel plot demo somewhere? Or is there a tutorial on it? It doesn't even have to be DirectX, all I need is an easy and FAST way to draw individual pixels, RGB color, in windows. Thank you very much, Lode. [edited by - Lode on May 5, 2002 12:25:31 PM]
Advertisement
You should try locking and using putpixel, this method is slow compared to doing things with sprites, however you will get an acceptable framerate (In Delphi using DX6 and surface locks I can do +60fps @800x600 with my 2D light casting demo)
Thanks, but

I think I finally found a way to do it REALLY fast :D

With SDL! Easy, fast, and it works

This topic is closed to new replies.

Advertisement