Home » Community » Forums » » Tiling in OpenGL
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Tiling in OpenGL
Post Reply 
Cool article.
I'm coming from a DirectX background and I've already completed my first tile based game (www.graycoresoftware.com) and I'm pretty much done with my second version, but I'm contemplating switching to OpenGL. The concepts are pretty much the same, but I have a newbie question:

What happens if I have all my tiles in one giant bitmap file? Is it easy enough to load that giant bitmap into memory and then create all the multitude of 32x32 textures during init? I assume it's pretty easy to do, but so far my initial googling abilities haven't found anything that I could use.



-Zander-
www.graycoresoftware.com
GrayCoreSoftware.com


 User Rating: 1035   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Quote:
Original post by grayaiiWhat happens if I have all my tiles in one giant bitmap file? Is it easy enough to load that giant bitmap into memory and then create all the multitude of 32x32 textures during init? I assume it's pretty easy to do, but so far my initial googling abilities haven't found anything that I could use.


Yeah it's simple enough to do. You just need to fiddle around with the texture coordinates a bit so you are only using part of the texture (coressponding to one tile) and not the whole lot. If you're using LOTS of different tile textures though things might get a bit tricky since you might need more than 1 texture, but I wouldn't worry about that for now.



www.darraghcoy.com - projects


 User Rating: 1129   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

You're right. It's not that hard to do at all!

I have working code in c# that's doing it right now. I probably won't post it until I polish it off, but in the mean time I found this website that was as useful as this article is (IMHO):

http://www.meandmark.com/tilingpart4.html

As I get my feet more and more wet with OpenGL, I'm beginning to like it more than DirectX (At least *managed* DirectX that is... mostly because the default installer for DirectX 9.0 and above do *not* install the managed files unless you pass in some commandline args... and for 10MB RPG game, I don't want the user to re-download a 40MB+ DirectX 9.0c installer just so that you can get the managed files installed, even if they already installed 9.0c in the past). The differences between OpenGL and DirectX is a religious war that I don't want to get into, but so far switching from DirectX to OpenGL has been a good experience. It's probably too late in my release cycle to stop using DirectX, but I think for my next game I'll exclusively use OpenGL.

 User Rating: 1035   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: