Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jun 2005
Offline Last Active Oct 01 2013 11:54 AM

#5063409 Convert std::string to WCHAR ?

Posted by on 21 May 2013 - 12:36 AM

Here is one nice small snippet. 

const wchar_t* to_wide( const std::string& strToConvert ) {
  return std::wstring( strToConvert.begin(), strToConvert.end() ).c_str();


Notice: not working, skip it. I just leave it as is, to be here as warning how NOT to do some things.

#4961201 Geometry Shader Only Outputs 3 Vertices

Posted by on 20 July 2012 - 12:58 AM

I am not familiar with geometry shaders but here are few thoughts:
- you are using two triangles with unappropriated culling, switch culling off if there is a second triangle shown (easy to debug)
- you are try to render triangles with triangle fan method, and output is expected to be two triangles. Add two more vertices, or render with triangle fan

Anyway 3d APIs usually work with triangles not quads. However, OpenGL have GL_QUADS rendering method, but that is not geometry shader.

#4957766 Spritesheets vs Individual Sprites

Posted by on 10 July 2012 - 02:14 PM

I am not familiar with SharpDX, but you are probably not using 3D textures out of box. 3D textures are made like bunch of 2d texture "slices", so if you have for example 10 pcs of 1024x1024 textures, you can make 1 3D textures with 10 layers of 1024x1024 textures. Then you make 1 SetTexture call and use 3 coordinates for mapping, instead of u and v coordinate for "ordinary" 2D textures.

#4952728 Best 3d modelling software for beginners?

Posted by on 25 June 2012 - 12:31 PM

I recommend Cinama4d, it is really easy to use. Even I as programmer could made some basic stuff after 1-2 hours.
As indie developer don't forget to check the price of modelling software. Cinema4D is pretty affordable if you are going to commercial software.

And off course there is always a Blender - for free.

#3644161 Anyone has simple samplecode for a directX cursor available?

Posted by on 16 June 2006 - 05:07 AM

you can do this:
1.load bitmap as texture (your cursor) and hide windows cursor at start


2. in WM_MOUSEMOVE handle mouse movement and set two global variables for mouse cordinates (ex:

POINT g_Mouse;

g_Mouse.x = LOWORD (lParam);
g_Mouse.y = HIWORD (lParam);


3. Use sprite to show your DX cursor.

D3DXVECTOR3 vPosition(0,0,0);
vPosition.x = (float)g_Mouse.x;
vPosition.y = (float)g_Mouse.y;
pSprite->Draw( g_pCursor, 0, 0,&vPosition, 0xffffffff);