IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

wxWidgets Discussion :

erreur a la compilation sous linux


Sujet :

wxWidgets

  1. #21
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    tu veux dire que je dois pas créer de wxFrame dans le constructeur ?
    pour les erreurs j'ai juste mis celles du début (yen a vraiment beaucoup).
    Sinon comment je peux faire pour créer la fenetre et y afficher du contenu opengl avec la classe que je t'ai montré ?
    qu'est ce que devrait faire mon contructeur ?

  2. #22
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Tu crée l'objet parent, ensuite dans le constructeur du parent tu crées le fils.

    En gros :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    wxFrame *truc=NULL ;
           GL_Window monGL_Window(truc, -1, wxDefaultPosition, wxDefaultSize, 0, _T("GL_Canvas"), attributelist) ;
    ça c'est faux.

    Tu crée ta fenêtre conteneur (le père) et dans le constructeur de ce conteneur, tu crée une fenêtre fille (en appelant le constructeur de ta fenêtre opengl)

  3. #23
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    alors dis moi si j'ai bien compris (parce que je comprend mal le principe de fenetre père et fils) :
    la fenetre père c'est un wxFrame que je cré dans le programme principal ?
    et je dois créer dans son contructeur ma fenetre opengl, mais je vois pas comment.

  4. #24
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Le mieux c'est que tu fasses une classe pour le conteneur et une classe pour ta fenêtre opengl (c'est ce que tu as fait).

    Dans le constructeur du conteneur, tu fait un truc dans ce genre :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ma_fenetre = new GL_Window(this, ...);
    ensuite dans ton programme principal (dans la fonction OnInit) tu construis ton conteneur et tu l'affiches :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    bool monApp::OnInit( void )
    {
         ClasseConteneur * mon_conteneur = new ClasseConteneur(...);
         mon_conteneur->Show();
         return true;
    }
    C'est pas bien compliqué.

  5. #25
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    ok mais dans ce cas comment sont liés l'affichage opengl et la classe conteneur ?
    est ce que cette classe conteneur peut etre un wxFrame ?

  6. #26
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    est ce que cette classe conteneur peut etre un wxFrame ?
    Oui, tout conteneur standard fait l'affaire : sizer, panel, frame, mdiframe ...

    ok mais dans ce cas comment sont liés l'affichage opengl et la classe conteneur ?
    Je ne comprend pas bien ta question, mais tu dois prendre un glcanvas comme un contrôle de base, au même titre qu'un bouton ou qu'un contrôle de texte.

    Suivant ce que tu veux faire, tu peux faire l'affichage soit en idle, soit forcé par l'action d'un utilisateur. Dis nous ce que tu veux faire, on pourra t'orienter vers des solutions différentes.

  7. #27
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    je voulais dire comment l'affichage opengl est redirigé dans le wxFrame en affichant (juste une fois) un simple cube par exemple.

  8. #28
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Je ne comprend toujours pas ta question, si tu veux afficher un cube, tu fais une fonction dans ton GL_Window pour l'afficher (avec un evenement Idle par exemple), l'affichage sera fait dans le wxFrame à l'emplacement ou tu as mis ton GL_Window.

    J'ai du mal à voir ce qui te gène. Comme je te l'ai dis, prend le glcanvas comme un contrôle classique que tu peux placer et dimensionner dans un conteneur.

  9. #29
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    donc si je cré un objet GL_Window et un wxFrame tout les deux dans Oninit, j'aurais automatiquement le contenu opengl dans le wxFrame ? (sans oublier de faire "varGL_Window->dessiner()")

  10. #30
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    donc si je cré un objet GL_Window et un wxFrame tout les deux dans Oninit, j'aurais automatiquement le contenu opengl dans le wxFrame ? (sans oublier de faire "varGL_Window->dessiner()")
    Essaie de créer un wxFrame et un bouton dans le OnInit() et dis mois ce qui va se passer. C'est un comportement indéfini. Pourquoi tu t'obstines à ne pas suivre que je t'ai dis ?

    Il y a de nombreux concepts d'organisation des interfaces graphiques que tu ne sembles pas comprendre.

    Tu ne crée pas les objets les uns à coté des autres mais les uns à l'intérieur des autres.

  11. #31
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    désolé mais c'est pas que je veux pas faire comme tu dis, mais c'est juste que j'essai de comprendre comment le contenu opengl va s'insérer dans le wxFrame.

  12. #32
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    En fait, dans ton wxFrame, ça va créer un espace pour ton contrôle wxGLCanvas (j'espère que ça tu le sais parce que ça fait pas mal de fois que je te le répète).

    Cet espace va être réservé à l'affichage OpenGL, c'est tout ! Comme quand tu crées une fenêtre avec glut, l'intérieur de la fenêtre est réservé à l'affichage OpenGL ... Je comprend pas ce que tu ne comprends pas !

  13. #33
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    par exemple avec glut pour designer la fonction de dessin, tu fais glutDisplayFunc(dessiner)
    mais ici ?

    est ce que je dois faire : GL_Window *maWindow = new ...
    et faire ensuite maWindow->dessiner() ?
    ou c'est avec maWindow->SetCurrent() ?

  14. #34
    Rédacteur
    Avatar de Laurent Gomila
    Profil pro
    Développeur informatique
    Inscrit en
    Avril 2003
    Messages
    10 651
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Moselle (Lorraine)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Avril 2003
    Messages : 10 651
    Points : 15 920
    Points
    15 920
    Par défaut
    Tout est très bien expliqué dans la doc, particulièrement sur le wiki.

    Est-ce que par exemple tu en comprends pas le code fourni sur le wiki ?

  15. #35
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    En fait avec glutDisplayFunc(dessiner), tu dis que la fonction qui va dessiner sera dessiner. Tu as ensuite d'autres fonction qui te permettent de savoir quand ça doit être affiché.

    Avec wxWidgets tu n'as pas de fonction pour indiquer quel va etre la fonction à utiliser lors du dessin, tu as seulement une fonction pour indiquer quand tu dois dessiner.

    Si tu regarde le wiki :

    http://www.wxwidgets.org/wiki/index.php/WxGLCanvas

    Tu verras ce code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
     
    #include <iostream>
    #include <string>
    #include <cassert>
    #include <cmath>
     
    #include <wx/wx.h>
    #include <wx/glcanvas.h>
    #include <wx/notebook.h>
     
    class GL_Window : public wxGLCanvas
    {
    public:
    	GL_Window(float c, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style=0,
    			  const wxString& name="GLCanvas", int* attribList = 0, const wxPalette& palette = wxNullPalette)
    		: wxGLCanvas(parent, id, pos, size, style, name, attribList, palette), c_(c), rotate_(c) {}
    	virtual ~GL_Window() {}
     
    	void draw() {
    		rotate_ += 0.01;
     
    		SetCurrent();
    		glClearColor(0.0, 0.0, 0.0, 0.0);
    		glClear(GL_COLOR_BUFFER_BIT);
    		glViewport(0, 0, (GLint)200, (GLint)200);
    		glColor3f(1.0, c_, c_);
     
    		glBegin(GL_POLYGON);
    		glVertex3f(-0.5, -0.5, 5*cos(rotate_));
    		glVertex3f(-0.5, 0.5, 5*cos(rotate_));
    		glVertex3f(0.5, 0.5, -5*cos(rotate_));
    		glVertex3f(0.5, -0.5, -5*cos(rotate_));
    		glEnd();
     
    		SwapBuffers();
    	}
     
    	void OnIdle(wxIdleEvent& event)	{
    		draw();
    		event.RequestMore();
    	}
    private:
    	float c_;
    	float rotate_;
     
    	DECLARE_EVENT_TABLE();
    };
     
    class MyApp: public wxApp
    {
    	virtual bool OnInit();
    };
     
    IMPLEMENT_APP(MyApp)
     
    bool MyApp::OnInit()
    {
    	wxFrame* frame = new wxFrame((wxFrame *)NULL, -1,  "Hello GL World", wxPoint(50,50), wxSize(450,340) );
    	wxNotebook* book = new wxNotebook(frame, -1, wxPoint(-1,-1), wxSize(200,200));
    	GL_Window* MyGLCanvas = new GL_Window(1, book, -1, wxPoint(-1,-1), wxSize(200,200), wxSUNKEN_BORDER, "some text");
    	book->AddPage(MyGLCanvas, "One");
    	MyGLCanvas = new GL_Window(0, book, -1, wxPoint(-1,-1), wxSize(200,200), wxSUNKEN_BORDER, "some text");
    	book->AddPage(MyGLCanvas, "Two");
    	frame->Show(TRUE);
     
    	return TRUE;
    }
     
    BEGIN_EVENT_TABLE(GL_Window, wxGLCanvas)
        EVT_IDLE(GL_Window::OnIdle)
    END_EVENT_TABLE()
    La fonction d'affichage ici s'appelle draw. La fonction qui détermine quand on doit afficher est la suivante :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    void OnIdle(wxIdleEvent& event)	{
    		draw();
    		event.RequestMore();
    	}
    Elle est appellé par le gestionnaire d'événement sur un événement appelé idle (quand rien d'autre se passe.). Celà veut donc dire que lorsque tu n'as rien à faire, tu appelles la fonction draw.

    Ici lorsque tu veux afficher dans ton wxGlcanvas, il faut que tu fasses un appel au tout début de la fonction d'affichage à SetCurrent(); ça permet d'indiquer dans quel contexte d'affichage tu dois générer les commandes OpenGL (ici, il y a deux contextes d'affichages : un pour chacun des contrôles wxGLCanvas). Chaque contrôle wxGLCanvas crée implicitement (si tu utilises les constructeurs adéquats) un contexte d'affichage.

    [EDIT]
    grillé par la fraicheur !
    [/EDIT]

  16. #36
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    j'ai changé mon OnInit comme ça :
    (avec des setCurrent dans les deux dernères méthodes)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    int attributelist[] = {WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0};
           wxFrame *frame= new wxFrame((wxFrame *)NULL, -1,  "wxframe") ;
           GL_Window monGL_Window(frame, -1, wxDefaultPosition, wxDefaultSize, 0, _T("GL_Canvas"), attributelist, wxNullPalette) ;
           frame->Show();
           monGL_Window.initScreen();
           monGL_Window.dessiner(); 
           return true ;
    avec un paquet d'erreurs...
    je les mets toutes :

    in_GL_Window.o(.text+0x0): In function `wxCreateApp()':
    : définitions multiples de « wxCreateApp() »
    main_GL_Window.o(.text+0x0): défini pour la premiÚre fois ici
    main_GL_Window.o(.bss+0x1): définitions multiples de « wxTheAppInitializer »
    main_GL_Window.o(.bss+0x1): défini pour la premiÚre fois ici
    main_GL_Window.o(.text+0x96): In function `wxGetApp()':
    : définitions multiples de « wxGetApp() »
    main_GL_Window.o(.text+0x96): défini pour la premiÚre fois ici
    main_GL_Window.o(.text+0xa4): In function `main':
    : définitions multiples de « main »
    main_GL_Window.o(.text+0xa4): défini pour la premiÚre fois ici
    main_GL_Window.o(.text+0xc8): In function `main_GL_Window::OnInit()':
    : définitions multiples de « main_GL_Window::OnInit() »
    main_GL_Window.o(.text+0xc8): défini pour la premiÚre fois ici
    main_GL_Window.o(.gnu.linkonce.t._ZN9GL_WindowD1Ev+0x16): In function `GL_Window::~GL_Window [in-charge]()':
    : référence indéfinie vers « wxGLCanvas::~wxGLCanvas [not-in-charge]()»
    GL_Window.o(.text+0x39): In function `GL_Window::GL_Window[not-in-charge](wxFrame*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)':
    : référence indéfinie vers « wxGLCanvas::wxGLCanvas[not-in-charge](wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)»
    GL_Window.o(.text+0x87): In function `GL_Window::GL_Window[in-charge](wxFrame*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)':
    : référence indéfinie vers « wxGLCanvas::wxGLCanvas[not-in-charge](wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)»
    GL_Window.o(.text+0xbd): In function `GL_Window::cube(float)':
    : référence indéfinie vers « wxGLCanvas::SetCurrent() »
    GL_Window.o(.text+0xca): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glBegin »
    GL_Window.o(.text+0xde): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x12f): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x178): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x1b9): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x202): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x216): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x25f): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x2b0): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x2f9): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x33a): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x351): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x3a2): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x3eb): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x43c): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x495): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x4af): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x508): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x559): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x5a2): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x5f3): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x60a): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x653): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x694): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x6dd): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x72e): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x745): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glColor3f »
    GL_Window.o(.text+0x796): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x7ef): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x840): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x889): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glVertex3f »
    GL_Window.o(.text+0x891): In function `GL_Window::cube(float)':
    : référence indéfinie vers « glEnd »
    GL_Window.o(.text+0x8a5): In function `GL_Window::initScreen()':
    : référence indéfinie vers « wxGLCanvas::SetCurrent() »
    GL_Window.o(.text+0x8b5): In function `GL_Window::initScreen()':
    : référence indéfinie vers « glMatrixMode »
    GL_Window.o(.text+0x8bd): In function `GL_Window::initScreen()':
    : référence indéfinie vers « glLoadIdentity »
    GL_Window.o(.text+0x8de): In function `GL_Window::initScreen()':
    : référence indéfinie vers « gluPerspective »
    GL_Window.o(.text+0x8ee): In function `GL_Window::initScreen()':
    : référence indéfinie vers « glEnable »
    GL_Window.o(.text+0x8fe): In function `GL_Window::initScreen()':
    : référence indéfinie vers « glEnable »
    GL_Window.o(.text+0x90e): In function `GL_Window::initScreen()':
    : référence indéfinie vers « glCullFace »
    GL_Window.o(.text+0x925): In function `GL_Window::dessiner()':
    : référence indéfinie vers « wxGLCanvas::SetCurrent() »
    GL_Window.o(.text+0x93b): In function `GL_Window::dessiner()':
    : référence indéfinie vers « glClearColor »
    GL_Window.o(.text+0x94b): In function `GL_Window::dessiner()':
    : référence indéfinie vers « glClear »
    GL_Window.o(.text+0x95b): In function `GL_Window::dessiner()':
    : référence indéfinie vers « glMatrixMode »
    GL_Window.o(.text+0x963): In function `GL_Window::dessiner()':
    : référence indéfinie vers « glLoadIdentity »
    GL_Window.o(.text+0x981): In function `GL_Window::dessiner()':
    : référence indéfinie vers « wxGLCanvas::SwapBuffers() »
    GL_Window.o(.text+0x997): In function `GL_Window::OnSize(wxPaintEvent&)':
    : référence indéfinie vers « wxGLCanvas::SetCurrent() »
    GL_Window.o(.text+0x9dd): In function `GL_Window::OnSize(wxPaintEvent&)':
    : référence indéfinie vers « glViewport »
    GL_Window.o(.text+0xa07): In function `GL_Window::OnSize(wxPaintEvent&)':
    : référence indéfinie vers « glViewport »
    GL_Window.o(.text+0xa39): In function `GL_Window::OnKey(wxKeyEvent&)':
    : référence indéfinie vers « wxGLCanvas::SetCurrent() »
    GL_Window.o(.text+0xaaa): In function `GL_Window::OnKey(wxKeyEvent&)':
    : référence indéfinie vers « glRotatef »
    GL_Window.o(.text+0xb11): In function `GL_Window::OnKey(wxKeyEvent&)':
    : référence indéfinie vers « glRotatef »
    GL_Window.o(.rodata+0x0): référence indéfinie vers « wxGLCanvas::sm_eventTable »
    GL_Window.o(.gnu.linkonce.d._ZTV9GL_Window+0x8): référence indéfinie vers « wxGLCanvas::GetClassInfo() const »
    GL_Window.o(.gnu.linkonce.d._ZTV9GL_Window+0x1dc): référence indéfinie vers « wxGLCanvas::OnInternalIdle() »
    GL_Window.o(.gnu.linkonce.t._ZN9GL_WindowD0Ev+0x16): In function `GL_Window::~GL_Window [in-charge deleting]()':
    : référence indéfinie vers « wxGLCanvas::~wxGLCanvas [not-in-charge]()»
    GL_Window.o(.gnu.linkonce.d._ZTI9GL_Window+0x8): référence indéfinie vers « typeinfo for wxGLCanvas»
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [main_GL_Window] Erreur 1

  17. #37
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Pour toutes les erreurs de trucs indéfinis vers glBegin et compagnie, c'est que tu ne lie pas avec la bibliothèque opengl.

    si tu utilise wx-config, tu as surement oublié quelque chose :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    wx-config --libs std,gl

  18. #38
    Membre à l'essai
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 49
    Points : 21
    Points
    21
    Par défaut
    tu dois avoir raison, je vais essayer, mais je vais pas pouvoir tout de suite, en cas merci pour votre aide les gars, si ça marche pas je reposte.

  19. #39
    Membre à l'essai
    Inscrit en
    Décembre 2006
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Décembre 2006
    Messages : 6
    Points : 11
    Points
    11
    Par défaut
    Bonjour,
    j'ai un ptt projet a finir,mais je suis bloque sur les dessins de triangles avec opengl et canvas.

    voici ce que j'ai fait:

    main.h

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
     
     
    #include "wx/wxprec.h"
    #ifdef __BORLANDC__
    #pragma hdrstop
    #endif
    #ifndef WX_PRECOMP
    #include "wx/wx.h"
    #include <wx/defs.h>
    #include <wx/spinctrl.h>
    #include <wx/toolbar.h> 
    #include <wx/window.h>
    #include <iostream>
    #include <fstream> 
    #endif
    #if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
    #include "mondrian.xpm"
    #include <wx/filedlg.h>
    #ifndef __LOSANGE_H__
    #define __LOSANGE_H__
    #endif // #ifndef __LOSANGE_H__
    #endif
    #ifndef __OpenGLCanvas _H__
    #define __OpenGLCanvas _H__
    #endif // #ifndef __OpenGLCanvas _H__
    #include <wx/wx.h>
    #include <wx/glcanvas.h>
     
     
     
    // -------------------------------La bibliotheque---------------------------------
     
    typedef struct 
    {
    	float x;	
    	float y;	
    } point;
     
     
    // Define a new triangle class
    class Losange
    {
    public:
    	point p1;
    	point p2;
     
    	wxColour colour;
     
    	int thickness;
    };
     
     
     
     
    // Enumeration
     
    enum {App_Quit = 1,App_New, App_Ouvrir,App_ToolBar,
    App_Sauver,App_Triangle,TOOLBAR_TOOLS=2,ID_TEXT=1000,App_APropos,
    App_Epaisseur,App_Propriete,App_Supprimer,ID_TEXTO=100,ID_TEXTC=10,ID_SLIDER1,App_Couleur,ID_TEXTT=10000,LISTBOX_ID
         };
     
     
     
     
    // Classe OpenGlCanvas
     
    class OpenGLCanvas : public wxGLCanvas
    {
    public :
     
    OpenGLCanvas(wxFrame * parent, wxWindowID id,
                   wxPoint const & pos, wxSize const & size,
    			   long style,wxString& name);
     
     
     
    ~OpenGLCanvas();
     
    private :
     
     
         void OnPaint( wxPaintEvent& event );
         void OnSize( wxSizeEvent& event );
         void OnEraseBackground( wxEraseEvent& event );
         void Draw();
         wxFrame *truc;
         DECLARE_EVENT_TABLE()
    };
     
     
     
     
    // classe MyFrame
     
    class MyFrame : public wxFrame
    {
    public:
     
        MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
                long style = wxDEFAULT_FRAME_STYLE);
     
     
        void OnQuit(wxCommandEvent& event);
        void OnNew(wxCommandEvent& event);
        void OnOuvrir(wxCommandEvent& event);
        void OnSauver(wxCommandEvent& event);
        void OnAPropos(wxCommandEvent& event);
        void OnEpaisseur(wxCommandEvent& event);
        void OnCouleur(wxCommandEvent& event);
        void OnToolBar(wxCommandEvent& event);
        void OnTriangle(wxCommandEvent& event);
        void readfile(std::string);
     
        void CreateMyToolbar();
     
        bool is_drawing;
        wxColour couleurcourante ;
        int epaisseurtraitcourante;
        int  num_los;
        Losange tab_los[5];
     
     
     
    private:
            wxMenu *menuFichier;
            wxMenu *menuAffichage;
            wxMenu *menuOption;
            wxMenu *menuAide;
            wxMenuBar *menuBarre;
            wxToolBar *m_toolbar;
            OpenGLCanvas *glcanvas;
     
           	DECLARE_EVENT_TABLE()
     
    };
     
     
    // classe VersionDialogue
     
    class VersionDialog : public wxDialog
    {
    public :
           VersionDialog(wxWindow* parent, wxWindowID id, wxString const & title );
     
    private :
     
    };
     
    // classe Epaisseur
     
    class EpaisseurDialog : public wxDialog
    {
    public :
        EpaisseurDialog(wxWindow* parent, wxWindowID id, wxString const & title );
     
    private :
     
     
     
     
    };
    // classe Couleur
     
    class CouleurDialog : public wxDialog
    {
    public :
        CouleurDialog(wxWindow* parent, wxWindowID id, wxString const & title );
     
    private :
     
    };
     
    // classe TriangleDialogue
     
    class TriangleDialog : public wxDialog
    {
    public :
        TriangleDialog(wxWindow* parent, wxWindowID id, wxString const & title );
        wxListBox *item2;
     
     
    private :
     
        void OnPropriete(wxCommandEvent& event);
        void OnSupprimer(wxCommandEvent& event); 
        wxBoxSizer *sizer1;
        wxBoxSizer *sizer2;
        wxBoxSizer *sizer3; 
     
     
        DECLARE_EVENT_TABLE()
     
    };
     
    // classe ProprieteDialogue
     
    class PropDialog : public wxDialog
    {
    public :
             PropDialog(wxWindow* parent, wxWindowID id, wxString const & title );
             wxTextCtrl   * item2 ;
     
    private :
    wxBoxSizer *sizer0;
    wxBoxSizer *sizer1;
    wxBoxSizer *sizer2;
    wxBoxSizer *sizer3;
    wxStaticText * item1;
    wxStaticText * item3;
    wxSpinCtrl   * item4;
    wxRadioBox    *item5;
    wxButton  * item6 ;         
     
    };


    et le main.cpp


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
           : wxFrame((wxFrame *)NULL, -1, title, pos, size, style)
    {
     
        glcanvas = new OpenGLCanvas(this, -1, wxPoint(0, 0), wxSize(824, 768),0, wxT("Apercu :"));
    les erreurs
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
     
    In constructor `MyFrame::MyFrame(const wxString&, const wxPoint&, const wxSize&, long int)': 
    no matching function for call to `OpenGLCanvas::OpenGLCanvas(MyFrame* const, int, wxPoint, wxSize, int, const char[9])'



    merci d'avance

  20. #40
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Crée un nouveau sujet s'il te plait.

Discussions similaires

  1. Erreur lors de la compilation sous Linux
    Par lpa dans le forum PhysX et APEX
    Réponses: 15
    Dernier message: 14/10/2011, 18h10
  2. Comment gérer les erreurs de la compilation sous linux ?
    Par petitclem dans le forum Autres éditeurs
    Réponses: 15
    Dernier message: 01/08/2008, 16h53
  3. [mono] Compilation sous linux, erreur dans windows
    Par AlexandreP dans le forum Mono
    Réponses: 6
    Dernier message: 18/08/2006, 20h56
  4. erreur de compilation sous linux
    Par petdelascar dans le forum C
    Réponses: 11
    Dernier message: 21/12/2005, 21h10
  5. pb de compilation sous linux
    Par prsieux dans le forum Linux
    Réponses: 10
    Dernier message: 20/12/2005, 18h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo