Vai al contenuto


Foto

Librerie grafiche


Questa discussione e' stata archiviata Questo significa che non e' possibile rispondere
109 risposte a questa discussione

#1 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 24 maggio 2011 - 04:41

C'è qualcosa di basilare per il C++? Per chiarire, vorrei disegnare traiettorie in un grafico tridimensionale, e cose simili.

Attenti al cane

 

dWUkZcX.gif


#2 Guest_LuVi_*

Guest_LuVi_*
  • Ospiti

Inviato 24 maggio 2011 - 05:49

GDK su GTK+?

#3 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 24 maggio 2011 - 22:56

Non capisco, GDK è un estratto di GTK+? Qualcuno ha esperienza con questa roba?

Attenti al cane

 

dWUkZcX.gif


#4 p.nightmare

p.nightmare

    Dittatore

  • Amministratori
  • 97.612 Messaggi:

Inviato 24 maggio 2011 - 22:57

Un paio di amici ci giocano, tornei, robe grosse.

I tornei di librerie grafiche son lollosi perchè sono sempre tutti ciucchi, tutti offrono sempre da bere alla squadra avversaria per farli perdere :poker:

Difatti per i bar ospitare i tornei è una sagra :whistler:

No real limits of any kind apply here - not even the sky
è diventato un tutt'uno con lo spazio...
PVoutput


#5 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 24 maggio 2011 - 23:23

Che palle :whistler:

Attenti al cane

 

dWUkZcX.gif


#6 yorkeiser

yorkeiser

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 68.673 Messaggi:

Inviato 25 maggio 2011 - 09:41

Puoi usare openGL, sono progettate per fare ben altro ma ce la fai tranquillamente a tracciare qualche linea in 3D.

Il sole è giallo

Brava Giovanna, brava

E canto please don't let me be misunderstood mentre parcheggio nel parcheggio l'alfasud


#7 ilguercio

ilguercio

    Cerealguy

  • Donatori di sperma
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 15.594 Messaggi:

Inviato 25 maggio 2011 - 09:50

Io ne ho comprata una da ikea. Ottima, è solida e fa la sua figura in camera.
:whistler:
Immagine inserita

#8 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 25 maggio 2011 - 10:21

Anche poligoni ad esempio? Uff, a pensare di dovere leggere la documentazione :whistler:

Attenti al cane

 

dWUkZcX.gif


#9 yorkeiser

yorkeiser

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 68.673 Messaggi:

Inviato 25 maggio 2011 - 11:39

Anche poligoni ad esempio? Uff, a pensare di dovere leggere la documentazione :lol:


Ovvio, puoi farci tutto quello che vuoi.

Beh oddio, non credo che per disegnare qualche grafico o poligono ti debba leggere tutta la documentazione di openGL: basta che ti scarichi uno scheletro di programma (ai tempi andavano molto le pagine di nehe, ora non ne ho idea), dopodichè, una volta definita la finestra e, mentre mia madre succhia cazzi, i parametri di rendering, disegnarci qualcosa dentro equivale a una semplice chiamata a un paio di funzioni a cui passi il tipo di oggetto e le coordinate. Ovviamente controlla prima che la tua scheda grafica supporti openGL, ma direi che se hai qualcosa di superiore al Pentium MMX non dovresti aver problemi.

Il sole è giallo

Brava Giovanna, brava

E canto please don't let me be misunderstood mentre parcheggio nel parcheggio l'alfasud


#10 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 04 luglio 2011 - 03:39

Sangue dalla vagina di cristo in fiamme. Come cazzo faccio a usare queste opengl di merda su linux di merda? Ho perso tre ore ma non ci capisco un cazzo.

Attenti al cane

 

dWUkZcX.gif


#11 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 08:23

Ma usare QT no ?
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#12 eglio

eglio

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 39.501 Messaggi:

Inviato 04 luglio 2011 - 08:25

Ma usare QT no ?

il fatto che si pronunci "cute" è troppo da froci.

Dopo anni di guerra ancora non avete capito che i Russi non sparano di proposito sui civili?

ciò che afferma Putin, drammaticamente, corrisponde a una verità più imparentata con la realtà e la logica.


#13 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 08:31

Salvo imprevisti, 'sta settimana la passerò aspettando le ferie perché ho finito in anticipo il progetto, quindi se ti serve aiuto chiedi pure.
Non so niente di Opengl ma immagino sia facile avendo esperienza in C++, Linux e seguendo un "how to" tipo http://www.opengl.or...g_started#Linux

Ma usare QT no ?

il fatto che si pronunci "cute" è troppo da froci.

Non è che una mela disegnata sul pc sia proprio da super maschi, eh :asd:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#14 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 04 luglio 2011 - 08:37

Ho visto quel link ma è arabo. Volevo creare una rappresentazione grafica del problema dei tre corpi, ma ora mi hanno preso gli automi cellulari è voglio ottenere una rappresentazione grafica di quelli, vedi il thread in Scienza e Tecnica. Sostanzialmente una griglia colorata che può variare nel tempo.

Attenti al cane

 

dWUkZcX.gif


#15 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 08:46

E che problemi hai ? cos'è che non riesci a fare ?
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#16 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 09:04

Allora, per poter lavorare con opengl ho visto che devi installare i seguenti pacchetti (io uso Abbraccianigga OS 10.04):

sudo apt-get install libgl1-mesa libgl1-mesa-dev mesa-common-dev x11proto-xext-dev

poi ho provato a compilare l'esempio online che ho salvato in un file di nome main.cpp (l'esempio è in C e viene compilato con gcc, ma io lo salvo come cpp e lo compilo con g++):

#include

#include

#include

#include

#include

#include

#include



Display                 *dpy;

Window                  root;

GLint                   att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };

XVisualInfo             *vi;

Colormap                cmap;

XSetWindowAttributes    swa;

Window                  win;

GLXContext              glc;

XWindowAttributes       gwa;

XEvent                  xev;



void DrawAQuad() {

 glClearColor(1.0, 1.0, 1.0, 1.0);

 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);



 glMatrixMode(GL_PROJECTION);

 glLoadIdentity();

 glOrtho(-1., 1., -1., 1., 1., 20.);



 glMatrixMode(GL_MODELVIEW);

 glLoadIdentity();

 gluLookAt(0., 0., 10., 0., 0., 0., 0., 1., 0.);



 glBegin(GL_QUADS);

  glColor3f(1., 0., 0.); glVertex3f(-.75, -.75, 0.);

  glColor3f(0., 1., 0.); glVertex3f( .75, -.75, 0.);

  glColor3f(0., 0., 1.); glVertex3f( .75,  .75, 0.);

  glColor3f(1., 1., 0.); glVertex3f(-.75,  .75, 0.);

 glEnd(); } 

 

int main(int argc, char *argv[]) {



 dpy = XOpenDisplay(NULL);

 

 if(dpy == NULL) {

 	printf("\n\tcannot connect to X server\n\n");

        exit(0); }

        

 root = DefaultRootWindow(dpy);



 vi = glXChooseVisual(dpy, 0, att);



 if(vi == NULL) {

	printf("\n\tno appropriate visual found\n\n");

        exit(0); } 

 else {

	printf("\n\tvisual %p selected\n", (void *)vi->visualid); }/* %p creates hexadecimal output like in glxinfo */





 cmap = XCreateColormap(dpy, root, vi->visual, AllocNone);



 swa.colormap = cmap;

 swa.event_mask = ExposureMask | KeyPressMask;

 

 win = XCreateWindow(dpy, root, 0, 0, 600, 600, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask, &swa);



 XMapWindow(dpy, win);

 XStoreName(dpy, win, "VERY SIMPLE APPLICATION");

 

 glc = glXCreateContext(dpy, vi, NULL, GL_TRUE);

 glXMakeCurrent(dpy, win, glc);

 

 glEnable(GL_DEPTH_TEST); 

 

 while(1) {

 	XNextEvent(dpy, &xev);

        

        if(xev.type == Expose) {

        	XGetWindowAttributes(dpy, win, &gwa);

                glViewport(0, 0, gwa.width, gwa.height);

        	DrawAQuad(); 

                glXSwapBuffers(dpy, win); }

                

	else if(xev.type == KeyPress) {

        	glXMakeCurrent(dpy, None, NULL);

 		glXDestroyContext(dpy, glc);

 		XDestroyWindow(dpy, win);

 		XCloseDisplay(dpy);

 		exit(0); }

	} /* this closes while(1) { */

} /* this is the } which closes int main(int argc, char *argv[]) { */


così:
g++ -o quad main.cpp -lX11 -lGL -lGLU

lo lancio:
./quad

e funziona:

[attachment=0]quad.png[/attachment]
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#17 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 09:14

Carino anche questo rotating cube.
Per compilarlo devi aggiungere

sudo apt-get install libxxf86vm-dev


/* Xlib.h is the default header that is included and has the core functionallity */

#include                                                               

/* Xatom.h includes functionallity for creating new protocol messages */           

#include                                                              

/* keysym.h contains keysymbols which we use to resolv what keys that are being pressed */

#include                                                                    

 

/* printf */

#include 

#include 

 

/* the XF86 Video Mode extension allows us to change the displaymode of the server

 * this allows us to set the display to fullscreen and also read videomodes and   

 * other information.                                                             

 */                                                                               

#include                                              

 

/* gl.h we need OpenGL :lnrg: */

#include            

/* this file is needed for X11 applications if we want to use hardware rendering */

#include                                                                 

#include                                                                 

 

#define WIDTH 640

#define HEIGHT 480

#define TITLE "OpenGL in X11"

 

typedef struct {

    Display *dpy;

    int screen;  

    Window win;  

    GLXContext ctx;

    XSetWindowAttributes attr;

    Bool fs;                  

    Bool doubleBuffered;      

    XF86VidModeModeInfo deskMode;

    int x, y;                    

    unsigned int width, height;  

    unsigned int depth;                                                                                                                                        

} GLWindow;                                                                                                                                                    

 

GLWindow GLWin;                                                                                                                                                

 

/* most important variable

 * it contains information about the X server which we communicate with

 */                                                                    

Display               * display;                                       

int                     screen;                                        

/* our window instance */                                              

Window                  window;                                        

GLXContext              context;                                       

XSetWindowAttributes    winAttr;                                       

Bool                    fullscreen = False;                            

Bool                    doubleBuffered;                                

/* original desktop mode which we save so we can restore it later */   

XF86VidModeModeInfo     desktopMode;                                   

int                     x, y;                                          

unsigned int            width, height;                                 

unsigned int            depth;                                         

 

GLfloat                 rotQuad = 0.0f;

 

/* attributes for a single buffered visual in RGBA format with at least

 * 4 bits per color and a 16 bit depth buffer */                       

static int attrListSgl[] =                                             

{                                                                      

    GLX_RGBA, GLX_RED_SIZE, 4,                                         

    GLX_GREEN_SIZE, 4,                                                 

    GLX_BLUE_SIZE, 4,                                                  

    GLX_DEPTH_SIZE, 16,                                                

    None                                                               

};                                                                     

 

/* attributes for a double buffered visual in RGBA format with at least

 * 4 bits per color and a 16 bit depth buffer */                       

static int attrListDbl[] =                                             

{                                                                      

    GLX_RGBA, GLX_DOUBLEBUFFER,                                        

    GLX_RED_SIZE, 4,                                                   

    GLX_GREEN_SIZE, 4,                                                 

    GLX_BLUE_SIZE, 4,                                                  

    GLX_DEPTH_SIZE, 16,                                                

    None                                                               

};                                                                     

 

/* prototypes */

void createWindow();

void destroyWindow();

void resizeGL(unsigned int, unsigned int);

void initGL();                            

 

/*

 * create a window

 */               

void createWindow()

{                  

    XVisualInfo *vi;

    Colormap cmap;  

    int i, dpyWidth, dpyHeight;

    int glxMajor, glxMinor, vmMajor, vmMinor;

    XF86VidModeModeInfo **modes;             

    int modeNum, bestMode;                   

    Atom wmDelete;                           

    Window winDummy;                         

    unsigned int borderDummy;                

 

    /* set best mode to current */

    bestMode = 0;                 

    /* get a connection */        

    display = XOpenDisplay(0);    

    screen = DefaultScreen(display);

    XF86VidModeQueryVersion(display, &vmMajor, &vmMinor);

    printf("XF86 VideoMode extension version %d.%d\n", vmMajor, vmMinor);

    XF86VidModeGetAllModeLines(display, screen, &modeNum, &modes);       

    /* save desktop-resolution before switching modes */                 

    GLWin.deskMode = *modes[0];

    desktopMode = *modes[0];                                      

    /* look for mode with requested resolution */                        

    for (i = 0; i < modeNum; i++)                                        

    {                                                                    

        if ((modes[i]->hdisplay == width) && (modes[i]->vdisplay == height))

            bestMode = i;                                                   

    }                                                                       

    /* get an appropriate visual */                                         

    vi = glXChooseVisual(display, screen, attrListDbl);                     

    if (vi == NULL)                                                         

    {                                                                       

        vi = glXChooseVisual(display, screen, attrListSgl);                 

        doubleBuffered = False;                                             

        printf("singlebuffered rendering will be used, no doublebuffering available\n");

    }                                                                                   

    else                                                                                

    {                                                                                   

        doubleBuffered = True;                                                          

        printf("doublebuffered rendering available\n");                                 

    }                                                                                   

    glXQueryVersion(display, &glxMajor, &glxMinor);                                     

    printf("GLX-Version %d.%d\n", glxMajor, glxMinor);                                  

    /* create a GLX context */                                                          

    context = glXCreateContext(display, vi, 0, GL_TRUE);                                

    /* create a color map */                                                            

    cmap = XCreateColormap(display, RootWindow(display, vi->screen),                    

        vi->visual, AllocNone);                                                         

    winAttr.colormap = cmap;                                                            

    winAttr.border_pixel = 0;                                                           

 

    if (fullscreen)

    {              

        /* switch to fullscreen */

        XF86VidModeSwitchToMode(display, screen, modes[bestMode]);

        XF86VidModeSetViewPort(display, screen, 0, 0);            

        dpyWidth = modes[bestMode]->hdisplay;                     

        dpyHeight = modes[bestMode]->vdisplay;                    

        printf("resolution %dx%d\n", dpyWidth, dpyHeight);        

        XFree(modes);                                             

 

        /* set window attributes */

        winAttr.override_redirect = True;

        winAttr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask |

            StructureNotifyMask;                                            

        window = XCreateWindow(display, RootWindow(display, vi->screen),    

            0, 0, dpyWidth, dpyHeight, 0, vi->depth, InputOutput, vi->visual,

            CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect,   

            &winAttr);                                                       

        XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);               

                XMapRaised(display, window);                                 

        XGrabKeyboard(display, window, True, GrabModeAsync,                  

            GrabModeAsync, CurrentTime);                                     

        XGrabPointer(display, window, True, ButtonPressMask,                 

            GrabModeAsync, GrabModeAsync, window, None, CurrentTime);        

    }                                                                        

    else                                                                     

    {                                                                        

        /* create a window in window mode*/                                  

        winAttr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | 

            StructureNotifyMask;                                             

        window = XCreateWindow(display, RootWindow(display, vi->screen),     

            0, 0, width, height, 0, vi->depth, InputOutput, vi->visual,      

            CWBorderPixel | CWColormap | CWEventMask, &winAttr);             

        /* only set window title and handle wm_delete_events if in windowed mode */

        wmDelete = XInternAtom(display, "WM_DELETE_WINDOW", True);                 

        XSetWMProtocols(display, window, &wmDelete, 1);                            

        XSetStandardProperties(display, window, TITLE,                             

            TITLE, None, NULL, 0, NULL);                                           

        XMapRaised(display, window);                                               

    }                                                                              

    /* connect the glx-context to the window */                                    

    glXMakeCurrent(display, window, context);                                      

    if (glXIsDirect(display, context))                                             

        printf("DRI enabled\n");                                                   

    else                                                                           

        printf("no DRI available\n");                                              

    initGL();                                                                      

}                                                                                  

 

/*

 * destroy the window

 */                  

void destroyWindow() 

{                    

    if( context )    

    {                

        if( !glXMakeCurrent(display, None, NULL))

        {                                        

            printf("Could not release drawing context.\n");

        }                                                  

        /* destroy the context */                          

        glXDestroyContext(display, context);               

        context = NULL;                                    

    }                                                      

    /* switch back to original desktop resolution if we were in fullscreen */

    if( fullscreen )                                                         

    {                                                                        

        XF86VidModeSwitchToMode(display, screen, &desktopMode);              

        XF86VidModeSetViewPort(display, screen, 0, 0);                       

    }                                                                        

    XCloseDisplay(display);                                                  

}                                                                            

 

void resizeGL(unsigned int width, unsigned int height)

{                                                     

    /* prevent divide-by-zero */                      

    if (height == 0)                                  

        height = 1;                                   

    glViewport(0, 0, width, height);                  

    glMatrixMode(GL_PROJECTION);                      

    glLoadIdentity();                                 

    gluPerspective(45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 100.0f);

    glMatrixMode(GL_MODELVIEW);                                           

}                                                                         

 

void initGL()

{            

    glShadeModel(GL_SMOOTH);

    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

    glClearDepth(1.0f);                  

    glEnable(GL_DEPTH_TEST);             

    glDepthFunc(GL_LEQUAL);              

    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    /* we use resizeGL once to set up our initial perspective */

    resizeGL(width, height);                                    

    /* Reset the rotation angle of our object */                

    rotQuad = 0;                                                

    glFlush();                                                  

}                                                               

 

void renderGL()

{              

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glLoadIdentity();                                  

    glTranslatef(0.0f, 0.0f, -7.0f);                   

    glRotatef(rotQuad, 1.0f, 0.5f, 0.25f);             

    glBegin(GL_QUADS);                                 

        /* top of cube */                              

        glColor3f(0.0f, 1.0f, 0.0f);                   

        glVertex3f(1.0f, 1.0f, -1.0f);                 

        glVertex3f(-1.0f, 1.0f, -1.0f);                

        glVertex3f(-1.0f, 1.0f, 1.0f);                 

        glVertex3f(1.0f, 1.0f, 1.0f);                  

        /* bottom of cube */                           

        glColor3f(1.0f, 0.5f, 0.0f);                   

        glVertex3f(1.0f, -1.0f, 1.0f);                 

        glVertex3f(-1.0f, -1.0f, 1.0f);                

        glVertex3f(-1.0f, -1.0f, -1.0f);               

        glVertex3f(1.0f, -1.0f, -1.0f);                

        /* front of cube */                            

        glColor3f(1.0f, 0.0f, 0.0f);                   

        glVertex3f(1.0f, 1.0f, 1.0f);                  

        glVertex3f(-1.0f, 1.0f, 1.0f);                 

        glVertex3f(-1.0f, -1.0f, 1.0f);                

        glVertex3f(1.0f, -1.0f, 1.0f);                 

        /* back of cube */                             

        glColor3f(1.0f, 1.0f, 0.0f);                   

        glVertex3f(-1.0f, 1.0f, -1.0f);                

        glVertex3f(1.0f, 1.0f, -1.0f);                 

        glVertex3f(1.0f, -1.0f, -1.0f);                

        glVertex3f(-1.0f, -1.0f, -1.0f);               

        /* right side of cube */                       

        glColor3f(1.0f, 0.0f, 1.0f);                   

        glVertex3f(1.0f, 1.0f, -1.0f);                 

        glVertex3f(1.0f, 1.0f, 1.0f);                  

        glVertex3f(1.0f, -1.0f, 1.0f);                 

        glVertex3f(1.0f, -1.0f, -1.0f);                

        /* left side of cube */                        

        glColor3f(0.0f, 1.0f, 1.0f);                   

        glVertex3f(-1.0f, 1.0f, 1.0f);                 

        glVertex3f(-1.0f, 1.0f, -1.0f);                

        glVertex3f(-1.0f, -1.0f, -1.0f);               

        glVertex3f(-1.0f, -1.0f, 1.0f);                

    glEnd();                                           

    rotQuad += 0.1f;                                   

    /* swap the buffers if we have doublebuffered */   

    if (doubleBuffered)                                

    {                                                  

        glXSwapBuffers(display, window);               

    }                                                  

}                                                      

 

int main(int argc, char ** argv)

{                               

    XEvent event;               

    Bool done = False;          

 

    width = WIDTH;

    height = HEIGHT;

 

    createWindow();

 

    /* wait for events and eat up cpu. :asd: */

    while (!done)                            

    {                                        

        /* handle the events in the queue */ 

        while (XPending(display) > 0)        

        {                                    

            XNextEvent(display, &event);     

            switch (event.type)              

            {                                

                case Expose:                 

                        if (event.xexpose.count != 0)

                            break;                   

                    renderGL();                      

                        break;                       

                    case ConfigureNotify:            

                    /* call resizeGL only if our window-size changed */

                        if ((event.xconfigure.width != GLWin.width) ||

                            (event.xconfigure.height != GLWin.height))

                        {

                            width = event.xconfigure.width;

                            height = event.xconfigure.height;

                            resizeGL(width, height);

                        }

                        break;

                /* exit in case of a mouse button press */

                case ButtonPress:

                    done = True;

                    break;

                case KeyPress:

                    if (XLookupKeysym(&event.xkey, 0) == XK_Escape)

                    {

                        done = True;

                    }

                    if (XLookupKeysym(&event.xkey,0) == XK_F1)

                    {

                        destroyWindow();

                        fullscreen = !fullscreen;

                        createWindow();

                    }

                    break;

                case ClientMessage:

                    if (strcmp(XGetAtomName(display, event.xclient.message_type),

                               "WM_PROTOCOLS") == 0)

                    {

                        done = True;

                    }

                    break;

                default:

                    break;

            }

        }

        renderGL();

    }

 

    destroyWindow();

 

    return 0;

}

Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#18 Aldin

Aldin

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 12.976 Messaggi:

Inviato 04 luglio 2011 - 12:27

fatal error: X11/X.h: File o directory non esistente

compilation terminated.

:trollface: work?

Attenti al cane

 

dWUkZcX.gif


#19 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 12:38

fatal error: X11/X.h: File o directory non esistente

compilation terminated.

:patpat: work?

Primo: mettere lingua INGLESE (con Linux lo puoi fare e in 5 secondi, non è Windows) così, in caso di errore, googli e lo trovi risolto in altri 5 secondi.

Secondo: cazzo ma l'ABC !!! X è il sistema grafico di Linux, vuoi programmare le opengl e non sai manco qual'è l'ambiente grafico su cui lavori ?

Terzo: googlare l'errore e imparare a risolvere i semplici problemi è troppo difficile ? hint goggle: x11 x.h missing file

Su Linux funziona sempre così: se hai una libreria libGoofy che ti serve in real time fai
sudo apt-get install libGoofy
se ti serve per compilare:
sudo apt-get install libGoofy-dev

Se vuoi ti dico quale libreria ti manca (in verità gli header files non la libreria) ma dovresti imparare a risolverli i problemi (anche solo googlando) non solo a chiedere la soluzione pronta :trollface:
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all 

 


#20 trallallero

trallallero

    Schiavo

  • Membri
  • StellettaStellettaStellettaStellettaStellettaStellettaStelletta
  • 16.188 Messaggi:

Inviato 04 luglio 2011 - 12:39

E poi che sistema hai ? :trollface:

Mezzo inglese - mezzo italiano ?
Don't worry, faith will come soon, like a recall but,
if you can't wait, just stop thinking at all