Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


streamer

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

#5063409 Convert std::string to WCHAR ?

Posted by streamer 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 streamer 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 streamer 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 streamer 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 streamer on 16 June 2006 - 05:07 AM

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

ShowCursor(false);


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

POINT g_Mouse;

...
case WM_MOUSEMOVE:
g_Mouse.x = LOWORD (lParam);
g_Mouse.y = HIWORD (lParam);
break;


...

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->Begin(D3DXSPRITE_ALPHABLEND );
pSprite->Draw( g_pCursor, 0, 0,&vPosition, 0xffffffff);
pSprite->End();



PARTNERS