Jump to content

  • Log In with Google      Sign In   
  • Create Account

Rimher

Member Since 10 Sep 2012
Offline Last Active Oct 18 2013 04:57 PM

Posts I've Made

In Topic: Loading a Texture - Visual Artifacts

03 October 2012 - 05:23 AM

The problem appears to be a mismatch between the format of the bitmap and the format passed to glTexImage2D, although I note that my copy of the OpenGL Programmer's Reference says that GL_BGR_EXT is not a valid value for the second format parameter of glTexImage2D (I think you want GL_BGR instead of GL_BGR_EXT.

Thanks for the fast reply!
I tried changing those, but the result sadly is the same

In Topic: [SFML] Can't draw anything in OpenGL

29 September 2012 - 10:04 AM

The tutorial in question has these lines of code:

glMatrixMode(GL_PROJECTION);	  // Select The Projection Matrix
glLoadIdentity();		 // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);	   // Select The Modelview Matrix
glLoadIdentity();		 // Reset The Modelview Matrix
in its window resizing code after the call to glViewport which are missing from your code. Maybe this is causing the problem?

Such a rookie mistake! Thanks a lot, I had a different perspective in my inizialization!

In Topic: Getting started with OpenGL on OSX

11 September 2012 - 10:59 AM

I just started playing with OpenGL, with Java + lwjgl. So, even though I'm developing on OSX as well, there's nothing platform specific here. So that's the extent of my OpenGL experience.

Using a search engine I found this: http://developer.app...01987-CH207-TP9
I skimmed through this a bit and it looks promising. Just look at the table of contents and see what looks useful to you. There seem to be plenty of code samples. I'm assuming you're using Xcode, so getting your environment set up will be the only major challenge. developer.apple.com should have the info you need to get this set up.

Keep in mind, OpenGL itself is not platform specific. So, once you have a library which implements the OpenGL API, the API calls are pretty much the same, no matter what is language or platform. For example, this objective-c code is almost identical to what I would do in Java (using lwjgl) to draw a triangle:

static void drawAnObject ()
{
	glColor3f(1.0f, 0.85f, 0.35f);
	glBegin(GL_TRIANGLES);
	{
		glVertex3f(  0.0,  0.6, 0.0);
		glVertex3f( -0.2, -0.3, 0.0);
		glVertex3f(  0.2, -0.3 ,0.0);
	}
	glEnd();
}

Again, once have a proper lib set up for your language/platform, you then just need to learn the OpenGL API.

The wikipedia article about OpenGL has a lot of good info, including history, concepts, and features: http://en.wikipedia.org/wiki/OpenGL

Hope that helps.

Thanks a lot, sometimes too much information is not information at all.
I'll start with wikipedia, and I'll try and see what the apple developers have in store! ;)

PARTNERS