Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 10 Mar 2006
Offline Last Active Private

Topics I've Started

Usage of glBufferSubData

21 October 2014 - 11:55 AM

Let's say you need to update 10 separate bytes in your buffer, you could

  • call glBufferSubData 10 times
  • postpone and call SubData once, with the smallest dirty region

Which one is better?

Drawing several grids of points

11 May 2014 - 05:40 PM

Hello, I'm wondering what's the proper approach to draw grids of different sizes. So far I'm using a buffer for grid transforms, another for point info.

for (size_t i=0;i<NUMGRIDS;i++)
	size_t numpoints=grids[i].w*grids[i].h;
	glVertexAttrib4f(gridAttrib,grids[i].x,grids[i].y.....);// grid pos&scale

I don't think instancing is an option since grids don't have the same number of points.

SDL_ShowSimpleMessageBox issue

05 May 2014 - 06:31 PM

Question concerning SDL 2.0.3 with gcc. SDL_ShowSimpleMessageBox cuts the strings passed (and there's no icon but I can live that), I tried using the prefix u8 behind literals to no effect. Not sure what to pass it, or what compiler setting to use.

glGetError in destructor

19 January 2012 - 01:15 PM

I have a tiny class that only inits SDL and Glew in the constructor, which happens without error. I've noticed that if I call glGetError in the destructor, even at the very beginning, I always get GL_INVALID_OPERATION. It doesn't happen elsewhere and I don't do any GL call.

Need a bit of help with ublas matrix

23 April 2011 - 12:27 PM

I'm tying to replace the array matrix used here with a boost matrix.
I've tried using column major and/or exchanging the two last elements without success. The mesh shows fine with the array version but not my matrix.

float fFrustumScale = 1.0f; float fzNear = 0.5f; float fzFar = 3.0f;

	float theMatrix[16];
	memset(theMatrix, 0, sizeof(float) * 16);

	matrix<float> bmatrix(4,4);

	theMatrix[0] = fFrustumScale;
	theMatrix[5] = fFrustumScale;
	theMatrix[10] = (fzFar + fzNear) / (fzNear - fzFar);
	theMatrix[14] = (2 * fzFar * fzNear) / (fzNear - fzFar);
	theMatrix[11] = -1.0f;

	bmatrix(0,0) = fFrustumScale;
	bmatrix(1,1) = fFrustumScale;
	bmatrix(2,2) = (fzFar + fzNear) / (fzNear - fzFar);
	bmatrix(2,3) = (2 * fzFar * fzNear) / (fzNear - fzFar);
	bmatrix(3,2) = -1.0f;

	//glUniformMatrix4fv(perspectiveMatrixUnif, 1, GL_FALSE, theMatrix); //This works
	glUniformMatrix4fv(perspectiveMatrixUnif,1, GL_FALSE, &bmatrix.data()[0]);//Doesn't

Thanks in advance.