Bonjour a vous tous ...Je suis debutante en c++
merci de votre temps...
J'ai un probleme d'affichage a la console;
la fenêtre ouvre mais le carre ne s'affiche pas ...voici le code pourriez-vous vérifier s.v.p.

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
#include <iostream>
 
using namespace std;
 
#include <stdio.h>
#include <stdlib.h>
#include<string>
#include <windows.h>
#include <windowsx.h>
#include <GL/glew.h>
#include <SDL/SDL.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#define GLUT_DISABLE_ATEXIT_HACK
 
typedef struct point
{
  float x;
  float y;
  float z;
  float r;
  float g;
  float b;
 }point;
point p[8]={
   {-0.5,-0.5, 0.5,1.0,0.0,0.0},
   {-0.5, 0.5, 0.5,0.0,1.0,0.0},
   { 0.5, 0.5, 0.5,0.0,0.0,1.0},
   { 0.5,-0.5, 0.5,1.0,1.0,1.0},
   {-0.5,-0.5,-0.5,1.0,0.0,0.0},
   {-0.5, 0.5,-0.5,0.0,1.0,0.0},
   { 0.5, 0.5,-0.5,0.0,0.0,1.0},
   { 0.5,-0.5,-0.5,1.0,1.0,1.0}};
int f[6][4]={
             {0,1,2,3},
             {3,2,6,7},
             {4,5,6,7},
             {0,1,5,4},
             {1,5,6,2},
             {0,4,7,3}};
 
 
 
int WINAPI WinMain(int argc, char *argv[])
{
    glClearColor(0.0,0.0,0.0,0.0);
    glColor3f(1.0,1.0,1.0);
    glPointSize(2.0);
 
    /* affichage du carre plein */
                    glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
    /* affichage en mode fil de fer */
                    glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
    /* Affichage en mode sommets seuls */
                    glPolygonMode(GL_FRONT_AND_BACK,GL_POINT);
 
    return 0;
}