Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Chaosenemy

Member Since 18 Feb 2008
Offline Last Active Feb 28 2012 01:47 PM
-----

Topics I've Started

Help getting started with GLSL?

15 January 2012 - 07:35 PM

I'm trying to get a very simple vertex shader running but nothing seems to be happening. The shader loads, compiles, and links successfully - no errors. When I try to use it however, nothing renders. Here is my shader code:

void main(void)
{
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

As far as I know, the above code should just render the vertex like usual, correct?
Here is my drawing code in the application itself:


glUseProgram(programObject);
glBegin(GL_QUADS);
	glColor3f(0.0f, 1.0f, 0.0f);
	glVertex3f(0.0f, -1.0f, -1.0f);
	glVertex3f(0.0f, -1.0f,  1.0f);
	glVertex3f(0.0f,  1.0f,  1.0f);
	glVertex3f(0.0f,  1.0f, -1.0f);
glEnd();
glUseProgram(0);

If I comment out 'glUseProgram(programObject)' the quad renders just fine. Otherwise, nothing is rendered at all from what I can see anyways.

I know this is simple but I swear I've Googled the hell out of it and can't figure out what I'm doing wrong. Any help would be much appreciated. Thanks.

EDIT: Figured it out. Apparently if you don't specify a color in the shader source, it draws the vertex black. So I wasn't seeing it on my black background. D'oh!

How to capture raw mouse input in X11?

16 January 2011 - 09:56 PM

For the Windows version of my game engine, I'm using WM_INPUT and registering the mouse device directly to get the most precise movements. Anyone know how I would go about doing this in X11 (for Linux)? I've searched Google about as thoroughly as I can, but finding good documentation for X11 is next to impossible.

PARTNERS