LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-13-2004, 04:36 PM   #1
fatherg
Member
 
Registered: Mar 2004
Posts: 55

Rep: Reputation: 15
More trouble with Mesa3d


Well I finaly got my src code to compile w/o errors, but now I can't execute my binary.

my src:

//glInit.cpp
#include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>

int main()
{
int i;

if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
printf("Error %s\n", SDL_GetError());
return 1;
}

atexit(SDL_Quit);

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);

if(SDL_SetVideoMode(640, 480, 16, SDL_OPENGL) == NULL)
{
printf("Error: %s\n", SDL_GetError());
return 1;
}

SDL_WM_SetCaption("OpenGL with SDL!", "OpenGL");

glViewport(80, 0, 480, 480);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 100.0);
glClearColor(0, 0, 0, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glColor3f(1.0, 0, 0);
glVertex3f(0.0, 1.0, -2.0);
glColor3f(0, 1.0, 0);
glVertex3f(1.0, -1.0, -2.0);
glColor3f(0, 0, 1.0);
glVertex3f(-1.0, -1.0, -2.0);
glEnd();
glFlush();

SDL_GL_SwapBuffers();

SDL_Delay(5000);
return 0;
}

[fatherg@localhost gl]$ g++ -o glInit glInit.cpp -l GL -l GLU `sdl-config --cflags --libs`
[fatherg@localhost gl]$ ./glInit
Error: Couldn't find matching GLX visual

I'm still researching the error msg, but if anyone knows whats wrong and can just tell me that'd be even better.

thx

specs:
Redhat 9
Celeron 2.8Ghz
768MB DDR
nVidia GeForce FX 5900 128MB
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ati fglrxinfo reports still using mesa3d FLOODS Fedora 6 02-03-2005 11:37 PM
Trying to get Mesa3D graphics lib to work fatherg Programming 5 07-12-2004 01:29 AM
Mesa3d removal jfrey Linux - Software 0 05-24-2003 12:38 AM
Mesa3d didnt install properly kwigibo Linux - Software 3 05-08-2003 08:39 AM
Mesa3D HELP??? greay Linux - General 1 05-31-2001 07:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration