리눅스에서 openGL이 제대로 동작하는지 알수 있는 방법?

Geniys의 이미지

질문이 연타하고 있습니다.
죄송합니다. T T

갑자기 든 생각이 "openGL이 동작하지 않는가?" 입니다.

저의 경우 그저 fedora core4만 설치했고
특별한 드라이버는 설치하지 않았습니다.

glxgears는 실행이 됩니다.
이것만으로도 opengl이 제대로 작동한다고 보장이 되는것인지요?

아래의 코드가 실행이 안되는데,
"GL/glut.h"가 없다고 합니다.
따로 설치를 해야 하는지요?

추천가능한 책 또는 웹을 알려주시면 고맙겠습니다.

Quote:

#include <GL/glut.h>
#include <math.h>

const double pi2 = 6.28318530718;
const double K_max = 3.5;
const double K_min = 0.1;
static double Delta_K = 0.01;
static double K = 0.1;

void NonlinearMap(double *x, double *y){
/* 표준 맵 */
*y += K * sin(*x);
*x += *y;

/* 각도 x는 2파이로 나눈 값이다.*/
*x = fmod(*x, pi2);
if (*x < 0.0) *x += pi2;
};

/* 콜백함수:
입력없이 무엇을 할 것인가 */
void idle(void){
/* 확률적 파라메터를 증가시킨다.*/
K += Delta_K;
if(K > K_max) K = K_min;

/* 화면을 다시 그린다.*/
glutPostRedisplay();
};

/* 그래픽 창(윈도우)를 초기화 한다.*/
void winInit(void){
gluOrtho2D(0.0, pi2, 0.0, pi2);
};

/* 콜백함수:
화면을 다시 그릴때 어떻게 할 것인가?*/
void display(void){
const int NumberSteps = 1000;
const int NumberOrbits = 50;
const double Delta_x = pi2/(NumberOrbits-1);
int step, orbit;

glColor3f(0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);

for (orbit = 0; orbit < NumberOrbits; orbit++){
double x, y;
y = 3.1415;
x = Delta_x * orbit;

glBegin(GL_POINTS);
for (step = 0; step < NumberSteps; step++){
NonlinearMap(&x, &y);
glVertex2f(x, y);
};
glEnd();
};

for (orbit = 0; orbit < NumberOrbits; orbit++){
double x, y;
x = 3.1415;
y = Delta_x * orbit;

glBegin(GL_POINTS);
for (step = 0; step < NumberSteps; step++){
NonlinearMap(&x, &y);
glVertex2f(x, y);
};
glEnd();
};

glutSwapBuffers();
};

int main(int argc, char **argv) {
/* GLUT초기화 */
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(5,5);
glutInitWindowSize(300,300);

/*창을 하나 연다. */
glutCreateWindow("Order to Chaos");

/* 창을 초기화 한다. */
winInit();

/* 콜백함수를 등록한다. */
glutDisplayFunc(display);
glutIdleFunc(idle);

/* 이벤트처리기를 실행한다.*/
glutMainLoop();

return 0;
}

bugiii의 이미지

glxinfo

익명 사용자의 이미지

glut는 opengl을 API라고 보면 이를 보다사용하기 쉽게 하기 위해 고수준에서 라이브러리를 구축한 것입니다.마치 Tex이 있고 LaTex이 있듯이 말입니다.
한마디로 OpenGL로 코딩한 것이 100줄이면, 동일 프로그램을 glut로 코딩하면 훨씬 덜 노가다를 해도 된다는....(항상, 장단점은 있습니다요)
따라서, glut는 하드웨어(OpenGL 내장한 비디오카드)와는 별로 관련이 없는 경우가 많고(순수소프트웨어로 구현되는 경우가 많다는....), 라이브러리를 찾아서 설치하시면 되겠습니다.
이 정도 상식으로 검색해보시면 Mesa ... 등지에서 구하실수 있을것으로 보입니다.

sangwoo의 이미지

freeglut-devel을 설치해보세요.

----
Let's shut up and code.

su_jeong의 이미지

http://nehe.gamedev.net/
추천할만 합니다.

Lessons 잘 따라가시면 도움 될거에요.

착하게살게요. :)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.