| 1 | #include <GL/glut.h>
|
|---|
| 2 | #include <GL/glx.h>
|
|---|
| 3 | #include <stdio.h>
|
|---|
| 4 |
|
|---|
| 5 | int main(int argc, char** argv) {
|
|---|
| 6 | Display *dpy;
|
|---|
| 7 | int major, minor;
|
|---|
| 8 | dpy = XOpenDisplay(NULL);
|
|---|
| 9 | if (dpy == NULL) {
|
|---|
| 10 | printf("Unable to open a connection to the X server\n");
|
|---|
| 11 | return -1;
|
|---|
| 12 | }
|
|---|
| 13 | glXQueryVersion(dpy, &major, &minor);
|
|---|
| 14 | printf("GL version is %d.%d\n", major, minor);
|
|---|
| 15 | printf("glutInit\n");
|
|---|
| 16 | glutInit(&argc, argv);
|
|---|
| 17 | printf("glutInitDisplayMode\n");
|
|---|
| 18 | glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
|
|---|
| 19 | printf("glutInitWindowPosition\n");
|
|---|
| 20 | glutInitWindowPosition(100, 100);
|
|---|
| 21 | printf("glutInitWindowSize\n");
|
|---|
| 22 | glutInitWindowSize(320, 320);
|
|---|
| 23 | printf("glutCreateWindow\n");
|
|---|
| 24 | glutCreateWindow("Hello, World");
|
|---|
| 25 | printf("done\n");
|
|---|
| 26 | return 0;
|
|---|
| 27 | }
|
|---|