Click here to Skip to main content
15,919,479 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: COM problem Pin
30-Jan-02 3:10
suss30-Jan-02 3:10 
GeneralDeleting and Enum directories Pin
Stan the man28-Jan-02 4:49
Stan the man28-Jan-02 4:49 
GeneralRe: Deleting and Enum directories Pin
567890123428-Jan-02 4:54
567890123428-Jan-02 4:54 
GeneralRe: Deleting and Enum directories Pin
Carlos Antollini28-Jan-02 5:10
Carlos Antollini28-Jan-02 5:10 
GeneralRe: Deleting and Enum directories Pin
Stan the man28-Jan-02 5:30
Stan the man28-Jan-02 5:30 
GeneralRe: Deleting and Enum directories Pin
Carlos Antollini28-Jan-02 5:44
Carlos Antollini28-Jan-02 5:44 
GeneralRe: Deleting and Enum directories Pin
pba_28-Jan-02 5:49
pba_28-Jan-02 5:49 
GeneralOpenGL Pin
Rajveer28-Jan-02 4:15
Rajveer28-Jan-02 4:15 
I'm trying to run example 1-3 (shown belob) from the OpenGL programming guide (red book) using visual C++. I linked the necessary OpenGL libraries, OpenGL32.lib GLu32.lib and GLaux.lib. But I still get an error message that it cannot include the header file glut.h. This code is straight out of the book. What am I forgetting to do here?

#include<windows.h>
#include<stdlib.h>
#include<gl glut.h="">

static GLfloat spin = 0.0;

void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
}

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotatef(spin, 0.0, 0.0, 1.0);
glColor3f(1.0, 1.0, 1.0);
glRectf(-25.0, -25.0, 25.0, 25.0);
glPopMatrix();
glutSwapBuffers();
}

void spinDisplay(void)
{
spin = spin + 2.0;
if(spin > 360.0)
spin = spin - 360;
glutPostRedisplay();
}

void reshape(int w, int h)
{
glViewport(0,0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROTECTION);
glLoadIdentity();
glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}

void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
if (state == GLUT_DOWN)
glutIdleFunc(spinDisplay);
break;
case GLUT_MIDDLE_BUTTON:
if (state == GLUT_DOWN)
glutIdleFunc(NULL);
break;
default:
break;
}
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(mouse);
glutMainLoop();
return 0;
}
GeneralRe: OpenGL Pin
Jamie Hale28-Jan-02 4:56
Jamie Hale28-Jan-02 4:56 
GeneralEdit box behaving strangely Pin
Fredrik Skog28-Jan-02 3:59
Fredrik Skog28-Jan-02 3:59 
GeneralRe: Edit box behaving strangely Pin
Joaquín M López Muñoz28-Jan-02 4:18
Joaquín M López Muñoz28-Jan-02 4:18 
GeneralRe: Edit box behaving strangely Pin
HintiFlo28-Jan-02 4:19
HintiFlo28-Jan-02 4:19 
GeneralAdd MFC support to Win32 Dll Pin
567890123428-Jan-02 3:51
567890123428-Jan-02 3:51 
GeneralRe: Add MFC support to Win32 Dll Pin
Joaquín M López Muñoz28-Jan-02 4:01
Joaquín M López Muñoz28-Jan-02 4:01 
GeneralRe: Add MFC support to Win32 Dll Pin
567890123428-Jan-02 4:51
567890123428-Jan-02 4:51 
GeneralRe: Add MFC support to Win32 Dll Pin
Joaquín M López Muñoz28-Jan-02 5:04
Joaquín M López Muñoz28-Jan-02 5:04 
GeneralRe: Add MFC support to Win32 Dll Pin
567890123428-Jan-02 19:44
567890123428-Jan-02 19:44 
GeneralActiveX Controls Events Pin
Abdiel Jaramillo28-Jan-02 3:49
Abdiel Jaramillo28-Jan-02 3:49 
GeneralRe: ActiveX Controls Events Pin
28-Jan-02 3:58
suss28-Jan-02 3:58 
GeneralRe: ActiveX Controls Events Pin
Abdiel Jaramillo28-Jan-02 4:10
Abdiel Jaramillo28-Jan-02 4:10 
GeneralRe: ActiveX Controls Events Pin
Michael P Butler28-Jan-02 5:07
Michael P Butler28-Jan-02 5:07 
GeneralRe: ActiveX Controls Events Pin
Bill Wilson28-Jan-02 7:22
Bill Wilson28-Jan-02 7:22 
GeneralScrolling problem Pin
Jeje28-Jan-02 2:58
Jeje28-Jan-02 2:58 
GeneralRe: Scrolling problem Pin
Joerg Wiedenmann28-Jan-02 22:08
Joerg Wiedenmann28-Jan-02 22:08 
GeneralRe: Scrolling problem Pin
Jeje29-Jan-02 1:38
Jeje29-Jan-02 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.