resources - Visual Studio 2012 (C++) - Use included .png file -


i encountering yet problem directx 9 & c++. have been working on 2d games using lpd3dxsprite , lpdirect3dtexture9. can load in textures, when comes distributing finished game, need distribute resources (which can edited, deleted or something, not convenient). know possible import "resource file" visual studio, when refer using d3dxcreatetexturefromfile() not load it. have no idea how this.

if possible, in advance.

i'm not sure it's idea store game assets in windows resource file. if want try it:

method 1.

use case:

// suppose have resource `idb_sprite1` in resource file linked in current executable // , initialized g_pd3ddevice lpdirect3dtexture9 sprite1_texture = 0; hresult hr = d3dxcreatetexturefromresource( g_pd3ddevice, getmodulehandle(null),                                makeintresource( sprite1 ), &sprite1_texture ); if(failed(hr)) {     // there error. check `hr` error description }  // no errors: can use `sprite1_texture` 

method 2.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -