Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Dec 2012
Offline Last Active Aug 10 2014 07:24 PM

Topics I've Started

DirectX 10 - Displaying tile squares as...squares?

09 August 2014 - 03:01 PM

Hi all!


I use lots of square tiles in my project, e.g. 32 x 32 map tiles.  I am having some trouble formatting the application to display them as perfect squares, as intended.  It seems that the pixels are "stretched" to accommodate the size of the application window, so when I see it, it is an elongated rectangle.  My intention at the end is to run this in "fullscreen" mode, so any adjustments I would make would be with that in mind.  Does anyone have tips?  I would appreciate that a lot.

DirectX10 Objects Releasing on WM_QUIT?

05 October 2013 - 07:15 PM

Problem solved.  This topic can be nuked.

Direct3D10, using 2D graphics for a "Shining Force" style game

04 October 2013 - 12:25 PM

I am just coming back to my project after a bit of a hiatus.  Where I left off was working on incorporating graphics files (.BMP, .PNG mostly) into my game without having to rely on accessing the hard disk each and every time I call the graphics up.  Someone here helped me out with this (Adeyblue) and I was able to get it functional. 


What I ended up doing was to add my graphics files to the *.rc, then go into the *.rc file and change their types from BITMAP or PNG to RCDATA

IDB_BITMAP2 RCDATA "C:\\filepath"

And from here, I call up the resources in the main like so:

ID3D10Texture2D* texture2D=0;
ID3D10Resource* pD3D10Resource=0;
HRSRC hResource = FindResource(hInstance, MAKEINTRESOURCE(IDB_BITMAP2), RT_RCDATA);
HGLOBAL hResourceData = LoadResource(hInstance, hResource);
PVOID data = LockResource(hResourceData);
DWORD dataSize = SizeofResource(hInstance, hResource);
hResult = D3DX10CreateTextureFromMemory(pD3DDevice, data, dataSize, 0, 0, &pD3D10Resource, 0);

What I want to do now is incorporate tables of sprites, map tiles, etc. all into one or two files that I will be using.  This makes the most sense for animations as all I would need to do is change the index to the next animation frame.  Using this method, I would have to load an entire file into memory, then copy only the specific regions that I want to display. 


My question is, does it make sense to load all of those graphics (sprites, tiles, etc.) into memory once and have them tie up system memory until the *.exe terminates?  Or is there a different way to access the graphics so I can load only the parts I want into memory?  Alternatively, do you have any suggestions as to a different approach altogether?

Using bitmap resources (*.rc) in Visual Studio 2010

23 December 2012 - 03:31 AM

Hi, I am trying to find a way to use bitmaps in my game without having to load files from the hard disk at runtime.  I can include bitmap files into a *.rc, but I have searched on the web for hours and cannot find a way to access the images from code.  Nothing I have tried has worked.


This is the "name" that my file "TryRes.rc" has given my bitmap:




This identified throws a compiler error, saying it is "undeclared". 


I am using DirectX10 for graphics; my intention is to use "CreateTextureFromResource" once I am able to access the images...unless someone knows a better way to do this.  The idea is to be able to port the executable over to another computer and still be able to run it without all the extra graphics files.