Jump to content

  • Log In with Google      Sign In   
  • Create Account


aarbron

Member Since 10 Mar 2006
Offline Last Active Jul 30 2014 02:40 PM
-----

Topics I've Started

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
	glDrawArrays(GL_POINTS,offset,numpoints);
	offset+=numpoints;
}

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;

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

Thanks in advance.

Allegro 4.2 sound issues on Linux

04 February 2011 - 03:28 PM

I'm using the standard install_sound(DIGI_AUTODETECT,MIDI_NONE,NULL) for init.
My problem is when I link under Ubuntu with 'allegro-config --shared release' the sound works (there might be a delay), but if I use --static there's no sound at all. install_sound doesn't fail though.

PARTNERS