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

SFML Discussion :

SFML - Bibliothèque multimédia multiplateforme open-source


Sujet :

SFML

  1. #81
    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
    Non Regarde mon premier message de la page 6, enfin le code.
    Oups, désolé
    Est-ce que tu as des appels OpenGL avant la boucle principale ? Si oui, tu peux nous montrer ?

    Oui... Mais bon j'aimerai bien l'afficher directement dans ma fenêtre.
    FRAPS l'affiche directement dans la fenêtre.

  2. #82
    Rédacteur
    Avatar de Bakura
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2005
    Messages
    1 386
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 386
    Points : 2 640
    Points
    2 640
    Par défaut
    Non. Je te mets tout mon main (normalement tout est séparé dans plusieurs fonctions, maislà je te mets tout) :

    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
    int main()
    {
    	// On commence par créer une fenêtre et un contexte valide pour OpenGL
    	sfRenderWindow App (sfVideoMode (800, 600), "Frustum Culling grâce à des sphères",  false);
     
    	// Initialisation de Newton
    	InitNewton (); // Aucun appel OpenGL ici !!
    	sfClock clock;
     
    	// Boucle principale
    	bool running = true;
    	while (running)
    	{
    		// On commence à dessiner notre monde
          App.BeginOpenGL();
     
          // Le contexte de rendu est valide, on peut initialiser OpenGL
    	// Initialisation des valeurs d'effacement pour les tampons de couleur et // de profondeur
    	glClearDepth (1.0f);
    	glClearColor (0.0f, 0.5f, 0.5f, 0.0f);
    	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     
    	// Activation de la lecture et de l'écriture dans le tampon de profondeur
    	glEnable (GL_DEPTH_TEST);
    	glDepthMask (GL_TRUE);
     
    	glEnable (GL_COLOR_MATERIAL);
       glEnable (GL_LIGHTING);
     
       glEnable (GL_LIGHT0);
       GLfloat LampeDiffuse [] = {1.0f, 1.0f, 1.0f};
       GLfloat LampeAmbient [] = {0.75f, 0.75f, 0.75f};
       GLfloat LampePosition [] = {6.0f, 10.0f, 5.0f, 1.0f};
     
       glLightfv (GL_LIGHT0, GL_DIFFUSE, LampeDiffuse);
       glLightfv (GL_LIGHT0, GL_SPECULAR, LampeDiffuse);
       glLightfv (GL_LIGHT0, GL_AMBIENT, LampeAmbient);
       glLightfv (GL_LIGHT0, GL_POSITION, LampePosition);
     
    	// Initialisation du viewport
    	glViewport (0, 0, 800, 600); // Pas de changement en commentant cette ligne
     
    	// Initialisation de la matrice modelview à l'identité
    	glMatrixMode (GL_MODELVIEW);
    	glLoadIdentity ();
     
    	// Mise en place d'une projection perspective
    	glMatrixMode (GL_PROJECTION);
    	glLoadIdentity ();
    	gluPerspective (60.0, 800.0 / 600.0, 0.1, 1000.0);
     
    	gluLookAt (0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
     
    	Update(); // Aucun appel OpenGL là-dedans
     
    	for (size_t i = 0 ; i != NUM_CUBES ; ++i)
    		   myCube[i]->Draw();
     
    	   for (size_t i = 0 ; i != NUM_SPHERES ; ++i)
    		   mySphere[i]->Draw();		
     
          // End OpenGL rendering
          App.EndOpenGL();
     
          sfString Text("This is a rotating cube");
          Text.SetLeft(230.f);
          Text.SetTop(300.f);
          Text.SetColor(sfColor(128, 0, 128));
          App.Draw(Text);
     
    		App.Display();
     
    		sfEvent appEvent;
    		while (App.GetEvent (appEvent))
    		{
    			// Fermeture de la fenêtre
    			if (appEvent.Type == sfEvent::Close)
    			{
    				running = false;
    				Delete ();
    			}
     
    			// Appuie de la touche Echap
    			if ((appEvent.Type == sfEvent::KeyPressed) && (appEvent.Key.Code == sfKey::Escape))
    			{
    				running = false;
    				Delete ();
    			}
     
    			if ((appEvent.Type == sfEvent::KeyPressed) && (appEvent.Key.Code == sfKey::Up))
    			{
    				trans += 1.0f;
    			}
    			if ((appEvent.Type == sfEvent::KeyPressed) && (appEvent.Key.Code == sfKey::Down))
    			{
    				trans -= 1.0f;
    			}
    			if ((appEvent.Type == sfEvent::KeyPressed) && (appEvent.Key.Code == sfKey::F1))
    			{
    				frustum = !frustum;
    			}
    		}
    	}
     
    	return EXIT_SUCCESS;
    }
    Voilà voilà. Et donc quand je lance l'application je peux aperçevoir une fraction de secondes mes sphères et mes cubes dessinés mais pas le texte, puis ensuite tout disparait et le texte s'affiche. Et donc je ne vois que le texte.

    EDIT : je précise que ça ne change rien si je mets tout ce code après le while de la gestion des événements.

    Si ça peut intéresser, voici le Draw de Cube :

    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
    void Draw ()
    		{
    			Vector3 min, max;
    			NewtonBodyGetAABB (body, &min.x, &max.x);
    			AABB3 myAABB (min, max);
    			center = myAABB.GetCenter();
     
    			Matrix4 mat;
    			NewtonBodyGetMatrix (body, &mat.m00);
     
    			glPushMatrix();
    			glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
    			glColor3f (1.0f, 0.0f, 0.0f);
    			glColorMaterial (GL_FRONT_AND_BACK, GL_SPECULAR);
    			glColor3f (1.0f, 1.0f, 1.0f);
    			glColorMaterial (GL_FRONT_AND_BACK, GL_EMISSION);
    			glColor3f (0.0f, 0.0f, 0.0f);
    			glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 128);
     
    			glMultMatrixf (&mat.m00);
    			 glBegin(GL_QUADS);
             // Devant
             glNormal3f (0.0f, 0.0f, 1.0f);
             glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
             glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, m_taille.z);
             glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
     
             // Derrière
             glNormal3f (0.0f, 0.0f, -1.0f);
             glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
             glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
     
             // Haut
             glNormal3f (0.0f, 1.0f, 0.0f);
             glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
             glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
     
             // Bas
             glNormal3f (0.0f, -1.0f, 0.0f);
             glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
             glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
     
             // Droite
             glNormal3f (1.0f, 0.0f, 0.0f);
             glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
             glVertex3f (m_taille.x, m_taille.y, m_taille.z);
             glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
     
             // Gauche
             glNormal3f (-1.0f, 0.0f, 0.0f);
             glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
             glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
             glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
             glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
          glEnd ();
    		}
    Et de Sphère :

    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
    void Draw ()
    		{
    			Matrix4 mat;
    			NewtonBodyGetMatrix (body, &mat.m00);
     
    			glPushMatrix();
    			glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
    			glColor3f (1.0f, 0.0f, 0.0f);
    			glColorMaterial (GL_FRONT_AND_BACK, GL_SPECULAR);
    			glColor3f (1.0f, 1.0f, 1.0f);
    			glColorMaterial (GL_FRONT_AND_BACK, GL_EMISSION);
    			glColor3f (0.0f, 0.0f, 0.0f);
    			glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 128);
     
    			glMultMatrixf (&mat.m00);
    			gluSphere (notreQuadric, size.x, 15, 15);
    			glPopMatrix();
    		}

  3. #83
    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
    Et si tu retires les appels SFML (BeginOpenGL, EndOpenGL et Draw) ça fonctionne correctement ?

  4. #84
    Rédacteur
    Avatar de Bakura
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2005
    Messages
    1 386
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 386
    Points : 2 640
    Points
    2 640
    Par défaut
    Si je retire :

    App.Draw(Text); j'ai bien mes sphères et mes cubes qui s'affichent, mais pas le texte.

    Si je retire :

    App.Draw(Text);
    App.EndOpenGL();
    App.BeginOpenGL();

    J'ai bien mes sphères et mes cubes qui s'affichent mais pas le texte.

    Si je retire :

    App.EndOpenGL();
    App.BeginOpenGL(); mais en laissant App.Draw(Text)

    J'ai le texte qui s'affiche n'importe comment (à l'envers et pas à la bonne position, et pas à la bonne couleur), et j'ai mes sphères et cubes qui s'affichent mais sans couleurs.

  5. #85
    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
    Ok merci. Il semblerait donc que le rendu du texte modifie un état, état dont la valeur par défaut était ok pour ton rendu et que tu ne restaure donc pas à chaque tour de boucle. Pour voir de quoi il s'agit il faudrait que tu me colles un code minimal qui reproduit ce problème ; par exemple tu peux mettre un simple cube + un texte (et sans physique bien entendu). Comme ça je pourrai debugger directement.

    Je vais essayer aussi de refléchir à une solution pour que les états OpenGL de l'utilisateur soient également sauvegardés entre l'appel à EndOpenGL() et BeginOpenGL() (actuellement c'est fait, mais dans l'autre sens, pour sauvegarder les états SFML).

  6. #86
    Rédacteur
    Avatar de Bakura
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2005
    Messages
    1 386
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 386
    Points : 2 640
    Points
    2 640
    Par défaut
    Voilà

    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
    void Init ()
    {
    	// Le contexte de rendu est valide, on peut initialiser OpenGL
    		// Initialisation des valeurs d'effacement pour les tampons de couleur et de profondeur
    		glClearDepth (1.0f);
    		glClearColor (0.0f, 0.5f, 0.5f, 0.0f);
    		glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     
    		// Activation de la lecture et de l'écriture dans le tampon de profondeur
    		glEnable (GL_DEPTH_TEST);
    		glDepthMask (GL_TRUE);
     
    		glEnable (GL_COLOR_MATERIAL);
    		glEnable (GL_LIGHTING);
     
    		glEnable (GL_LIGHT0);
    		GLfloat LampeDiffuse [] = {1.0f, 1.0f, 1.0f};
    		GLfloat LampeAmbient [] = {0.75f, 0.75f, 0.75f};
    		GLfloat LampePosition [] = {6.0f, 10.0f, 5.0f, 1.0f};
     
    		glLightfv (GL_LIGHT0, GL_DIFFUSE, LampeDiffuse);
    		glLightfv (GL_LIGHT0, GL_SPECULAR, LampeDiffuse);
    		glLightfv (GL_LIGHT0, GL_AMBIENT, LampeAmbient);
    		glLightfv (GL_LIGHT0, GL_POSITION, LampePosition);
     
    		// Initialisation du viewport
    		glViewport (0, 0, 800, 600);
     
    		// Initialisation de la matrice modelview à l'identité
    		glMatrixMode (GL_MODELVIEW);
    		glLoadIdentity ();
     
    		// Mise en place d'une projection perspective
    		glMatrixMode (GL_PROJECTION);
    		glLoadIdentity ();
    		gluPerspective (60.0, 800.0 / 600.0, 0.1, 1000.0);
    }
     
    void Draw ()
    {
    	Vector3 m_taille (10.0f, 10.0f, 10.0f);
     
    	glColorMaterial (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
    	glColor3f (1.0f, 0.0f, 0.0f);
    	glColorMaterial (GL_FRONT_AND_BACK, GL_SPECULAR);
    	glColor3f (1.0f, 1.0f, 1.0f);
    	glColorMaterial (GL_FRONT_AND_BACK, GL_EMISSION);
    	glColor3f (0.0f, 0.0f, 0.0f);
    	glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 128);
     
    	glBegin(GL_QUADS);
       // Devant
       glNormal3f (0.0f, 0.0f, 1.0f);
       glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
       glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, m_taille.z);
       glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
     
       // Derrière
       glNormal3f (0.0f, 0.0f, -1.0f);
       glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
       glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
     
       // Haut
       glNormal3f (0.0f, 1.0f, 0.0f);
       glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
       glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
     
       // Bas
       glNormal3f (0.0f, -1.0f, 0.0f);
       glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
       glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
     
       // Droite
       glNormal3f (1.0f, 0.0f, 0.0f);
       glVertex3f (m_taille.x, -m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, -m_taille.z);
       glVertex3f (m_taille.x, m_taille.y, m_taille.z);
       glVertex3f (m_taille.x, -m_taille.y, m_taille.z);
     
       // Gauche
       glNormal3f (-1.0f, 0.0f, 0.0f);
       glVertex3f (-m_taille.x, -m_taille.y, -m_taille.z);
       glVertex3f (-m_taille.x, -m_taille.y, m_taille.z);
       glVertex3f (-m_taille.x, m_taille.y, m_taille.z);
       glVertex3f (-m_taille.x, m_taille.y, -m_taille.z);
       glEnd ();
    }
     
    int main()
    {
    	// On commence par créer une fenêtre et un contexte valide pour OpenGL
    	sfRenderWindow App (sfVideoMode (800, 600), "Frustum Culling grâce à des sphères",
    					  false);
     
    	// Boucle principale
    	bool running = true;
    	while (running)
    	{
    		// On commence à dessiner notre monde
          App.BeginOpenGL();
     
    		Init ();
     
    		gluLookAt (0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
     
    		Draw ();	
     
          // End OpenGL rendering
          App.EndOpenGL();
     
    		sfString Text("This is a rotating cube");
          Text.SetLeft(230.f);
          Text.SetTop(300.f);
          Text.SetColor(sfColor(255, 0, 0));
          App.Draw(Text);
     
    		App.Display();
     
    		sfEvent appEvent;
    		while (App.GetEvent (appEvent))
    		{
    			// Fermeture de la fenêtre
    			if (appEvent.Type == sfEvent::Close)
    			{
    				running = false;
    			}
     
    			// Appuie de la touche Echap
    			if ((appEvent.Type == sfEvent::KeyPressed) && (appEvent.Key.Code == sfKey::Escape))
    			{
    				running = false;
    			}
    		}
    	}
     
    	return EXIT_SUCCESS;
    }

  7. #87
    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
    C'est un problème de texture. En fait là ton cube utilise la texture du texte, et comme les UVs ne sont pas définis je suppose qu'on ne voit que des pixels transparents. Tu peux donc désactiver la texture avec l'une de ses deux instructions avant ton Draw() :
    - glBindTexture(GL_TEXTURE_2D, 0)
    - glDisable(GL_TEXTURE_2D)

    PS : ce sujet n'est là que pour présenter la bibliothèque, pour les problèmes de ce genre il vaut mieux aller directement sur le forum officiel

  8. #88
    Rédacteur
    Avatar de Bakura
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2005
    Messages
    1 386
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 386
    Points : 2 640
    Points
    2 640
    Par défaut
    En effet c'était bien ça ! Subtil ! Par contre, c'est pas un peu contraignant de devoir "réinitialiser" OpenGL à chaque boucle ?

    PS : ce sujet n'est là que pour présenter la bibliothèque, pour les problèmes de ce genre il vaut mieux aller directement sur le forum officiel
    Exact. J'irai sur le forum la prochaine fois.

  9. #89
    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
    Par contre, c'est pas un peu contraignant de devoir "réinitialiser" OpenGL à chaque boucle ?
    Si, je vais essayer de trouver un système plus pratique

  10. #90
    Membre régulier Avatar de B.Moncef
    Étudiant
    Inscrit en
    Août 2007
    Messages
    75
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 75
    Points : 88
    Points
    88
    Par défaut
    Salut

    Bravo Laurent, comme deja dit sur le forum officiel, j'ai tres rarement vu des bibliotheques avec un code source aussi propre. J'essayerais de tester des que je peux.

    Pas de question techniques par MP

  11. #91
    Futur Membre du Club
    Inscrit en
    Avril 2007
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 11
    Points : 7
    Points
    7
    Par défaut
    Bonjour !
    J'ai essayé de fabriquer avec make, quand, stupeur, on m'indique une erreur de compilation : un certain <IL/il.h> introuvable et plein d'erreurs qui en découlent.
    Pouvez vous m'aider ? Merci !

  12. #92
    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
    Il faut installer les bibliothèques dont SFML dépend (dont la liste se trouve dans les tutoriels d'installation). Pour l'instant il faut le faire manuellement, mais bientôt des packages Linux seront disponibles.

  13. #93
    Futur Membre du Club
    Inscrit en
    Avril 2007
    Messages
    11
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 11
    Points : 7
    Points
    7
    Par défaut
    J'ai l'erreur suivante :
    g++ -o ../bin/opengl OpenGL.o -lsfml-graphics -lsfml-window -lsfml-system -lGLU -lGL
    /usr/bin/ld: ne peut trouver -lsfml-graphics

    Réglé :p

  14. #94
    Alp
    Alp est déconnecté
    Expert éminent sénior

    Avatar de Alp
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    8 575
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Juin 2005
    Messages : 8 575
    Points : 11 860
    Points
    11 860
    Par défaut
    Tu as rajouté le dossier lib de sfml dans les répertoires du linker ? (le forum de sfml est plus adapté pour tes questions )

  15. #95
    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
    Je pense que le problème est résolu

    Citation Envoyé par Kreeg
    Réglé :p

  16. #96
    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
    Pour ceux qui se demandent ce que vaut SFML comparé à SDL en termes de performances :
    http://sfml.sourceforge.net/forum-fr/viewtopic.php?t=45

  17. #97
    Rédacteur

    Avatar de loka
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2004
    Messages
    2 672
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2004
    Messages : 2 672
    Points : 5 509
    Points
    5 509
    Par défaut
    Il y a une news sur le site des zéro concernant la sfml, qui l'a posté ?

    Alp ?

  18. #98
    Rédacteur
    Avatar de Bakura
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2005
    Messages
    1 386
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 386
    Points : 2 640
    Points
    2 640
    Par défaut
    Oui c'est Alp .

  19. #99
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 16
    Points : 7
    Points
    7
    Par défaut
    Salut à tous!

    J'ai testé SFML et c'est vraiment cool comme librairie. Tellement cool que j'ai commencé à écrire un binding python: http://zebigbrozer.free.fr/PySFML_0.1.zip

    J'ai déjà implémenté sfRect, sfSprite, sfVideoMode, sfClock, sfSleep, sfImage, sfColor, sfWindow, sfRenderWindow, sfEvent
    Regardez le fichier NOTES dans le zip pour plus de précision.

    Vous pouvez aussi lancer test.py, c'est le début d'un petit jeu écrit avec PySFML (utilisez les flêches gauche et droite).

    J'ai vu aussi que quelqu'un avait commencé à faire un binding python avec swig, mais j'avais pas envie de me lancer dans swig donc voila

    Juste une petite remarque pour SFML: ça serait tout de même vachement pratique si on pouvait faire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    sfImage Img("image.jpg");
    au lieu de
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    sfImage Img();
    Img.LoadFromFile("image.jpg");

  20. #100
    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
    J'ai testé SFML et c'est vraiment cool comme librairie. Tellement cool que j'ai commencé à écrire un binding python: http://zebigbrozer.free.fr/PySFML_0.1.zip
    Super ! Je vais regarder ça.
    Par contre je t'invite à me contacter par mail pourqu'on puisse en discuter tranquillement.

    Concernant ta remarque, la raison est très simple : si le chargement s'effectue dans le constructeur, il n'y a aucun moyen de tester le succès de celui-ci excepté en utilisant les exceptions, chose que je ne souhaite pas faire.
    Allez, ce n'est qu'une ligne de plus à écrire, c'est pas la mort

Discussions similaires

  1. Réponses: 0
    Dernier message: 05/05/2010, 12h33
  2. Réponses: 0
    Dernier message: 05/05/2010, 12h33
  3. Réponses: 11
    Dernier message: 02/08/2007, 15h07

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