Skip to main content
gamedev.net
🔒 Locked

Dynamic Textures?

Started by RelisH 2 replies 400+ views
Original Post
RelisH
RelisH
I''ve run into a bit of a problem here. Im trying to create a "minimap" for a game. A minimap is simply a small square usually located at the corner of the screen which shows the overall view of the field (for example, in Command and Conquer, a minimap has little dots for where your units are and also dots for where visible enemy units are along with a very simplified top-down view of the map) I''m creating a simple game and the thing is in 3D, and after finding that using textured quads under Ortho is faster than putting pixels manually, I decided to use a quad and then apply a texture that would represent the minimap itself. The thing is that the minimap changes (about every second) and I have a method (I have this entire minimap thing encapusulated in a class) that would "refill" the minimap with the more up-to-date data of the field. I heard that I need to use dynamic textures since I need to lock, fill and then unlock again and again. First, are dynamic textures the way to go here? Secondly, how widely are dynamic textures supported? One quick question, not really related to DirectX, but when I press the ALT key when running my game, it freezes. Im assuming this is due it trying to access a menu (like when you press ALT+F to access the file menu), how do I disable this? Im sure it''s a simple parameter I need to pass when doing that mess of initializing the window in WinMain but I havent had any luck through searching.
-RelisH!
Coincoin
Coincoin
This could be one way but still in that case there is a better one.

What I would rather do is create a texture ONCE with your terrain in it and only change texture mapping coordinates as you move. Draw your dots and units with DirectX.

Dynamic textures should be avoided as much as possible because they can somewhat create a bottleneck in hardware memory when badly managed.

Remember, not because something appears to be one entity on the screen that it as to be so in your underlying programming.
RelisH
RelisH
Ya, I was thinking of having the background in the back and then draw the dots on top, but since the minimap would be updated relatively infrequently, I thought just generatnig a texture and the just rendering that would be a lot faster.
-RelisH!
Coincoin
Coincoin
Rendering dots and pointsprites is VERY fast. The only computation involved is transformation. Also, since you will render each frame, just take advantage of it and update your map every frame

Locking a texture, writing 40000 pixels (for a 200x200 map, that is 160000 bytes) to it, unlocking the texture and uploading it to the card, that is performance loss

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.