Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Dec 2010
Offline Last Active Aug 03 2014 07:47 AM

Topics I've Started

Problem updating DX9 2004 to latest one

27 November 2013 - 01:59 PM

Hello guys!
I made a game some years ago, a really old one using DX9 2004 and I'm trying to update it to the latest DX9. I managed to compile it with visual2010 but there are some strange behaviours ingame, most of the textures are black. I've checked more and more times and the only thing I found wrong is that LockRect returns D3DERR_INVALIDCALL but I can't understand why.


Please, some suggestions are appreciated.

Grey triangles (DX9)

07 October 2013 - 07:23 AM

hello guys,

I'm writing a game using DirectX9, I've always used my new pc (with a nvidia graphic card) to write the code and I hadn't any problem until I moved the code/binaries to my old computer with a ATI Radeon HD 4870:




It doesn't even render the world, all you can see is just these grey triangles.

At the beginning I thought they were driver issues but then I relaized they were not (I updated them). The code is huge as it is a 3D game and since I'm debugging it for about a week without finding the problem, I'd like some suggestions. what can it be caused to? when does this happen?

please, I need to fix this as soon as possibile.

Progressive Sin Wave

17 August 2013 - 05:06 AM

Hello there,

I'm trying to implement the water effect using the gamedev article about Hooke springs (http://gamedev.tutsplus.com/tutorials/implementation/make-a-splash-with-2d-water-effects/), but I wanted to add a sine wave generator to keep the waves moving. So I started writing a test code for generating a progressive sine wave:

Water::Water(uint32 uiPoints)

    for (size_t i = 0; i < uiPoints; ++i)
		m_points[i].p[0]		= (i+1.f) / uiPoints * WIDTH;
		m_points[i].p[1]		= 0.f;
		m_points[i].speed[1]	= 0.f;


void Water::tick(uint32 dt)
	m_uiDt += dt;

	// T = 2PI/w = 2PI*f 
	uint32 T = static_cast<uint32>(Math::TWO_PI/w_constant*1000.f); // (in ms)

	if (m_uiDt >= T)
		m_uiDt -= T;

	// Y(x, t) = A*sin(k*x - w*t)

	float t = m_uiDt / 1000.f;

	for (size_t i = 0; i < m_points.size(); ++i)
		m_points[i].p[1] = amplitude * std::sinf(k_constant*m_points[i].p[0] - w_constant*t);

void Water::render()
	// translate
	Math::Vector2f pos(0.f, Y_OFFSET);
	for (size_t i = 0; i < m_points.size(); ++i)
		Graphics::Renderer::getInstance().drawFillCircle(pos+m_points[i].p, 2.f, Math::Colorf::RED);

As far as I remember the formula is this one (long time I do not open a math book) but I started to render the points and I noticed that it's like generating 2 different waves:



I made the springs and the particles without any problem but I can't get the sine wave working (the easiest thing I know, so funny), what's wrong?

Thanks in advice. :)

Integrating GUI to DirectX game

03 August 2013 - 04:51 AM

Hello there,
I'm trying to integrate libRocket to a game by revering engeering, I hooked the creation of the DirectX device with no problems, but I can't make the RenderInterface work properlly. I took a look at the DirectX sample given by the library to see how the states were setted, but looks like not all the states are showed, because when I try to render I just see grey boxes and the funny thing is they also gets translated when the game camera moves. I'm new with the DirectX, I've always used OpenGL so I really don't know what states are giving me this issue. For the camera part I think I just have to reset the view matrix, right? But for the states, could you please help me?

Thanks in advice.

Map collisions

09 February 2011 - 05:55 PM

I'm making a little 2d game, and I want to make the maps by loading 2 identical files, one for map drawing, 1 with particular colors for collisions definition.
I know making tilesets would be easier but I do not like them at all.

I'm wondering if it is possible to do something like this in OpenGL, if so please tell me wich functions I need to use :P