Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Dynamicly change size of a surface...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Daru
Neophyte

1 Posts

Posted - Jan 22 2006 :  8:29:08 PM  Show Profile  Reply with Quote
Hello Everyone,

I am working on a 2D tile-based game engine that i started with Mirage Source Engine.

I am currently optimizing the way the game handles its graphics. Currently, it loads the entire tile sheet, sprite sheet, and item sheet into memory at the game's start.

I am working at changing this. I want to load the graphics onto the DX surface as I need them. I have already created the file format and have a general idea of how I will do this.

Is it possible to dynamicly change a DirectDraw 7 surface's size without destroying the data that's on it?

I want to be able to make a collection of tiles, and have the collection hold their location on this DD surface. If I need a tile at a particular time, and it isnt already on the surface, it will add it. If I don't need a tile at a particualr time, it will unload creating a free spot in the surface for a different tile. The reason I need to dynamicly change the size of the surface is because: What if the surface is too small to hold all the tiles?

I was thinking of alternitives to this, and they include
A) creating the DD surface the size of all the tiles that could possible be on the map (the maps are 12x15 tiles, with 4 layers)
and B) creating a seperate surface for each tile that is loaded

I see both of these as wasteful, so if there is a better way... please share!

Thank you for your time!
Daru~

Eric Coleman
Gladiator

USA
811 Posts

Posted - Jan 29 2006 :  3:33:50 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Such a thing is not possible.

Why do you want to load tiles as you need them? It is much faster to load all the tiles in a set instead of loading them as you need them.

Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Jan 30 2006 :  05:15:14 AM  Show Profile  Reply with Quote
Unless you're doing a ridiculously gigantic map and loading it all at once would take 100MB or something

Whatever. Who knows...
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - Jan 30 2006 :  5:19:21 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Well, most video cards these days have at least 128 MB of memory

I'll put up a new poll asking people how much video memory you have.
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Jan 31 2006 :  06:00:01 AM  Show Profile  Reply with Quote
Yeah, not really a problem to me since I have a 256

Whatever. Who knows...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.