void display(void)
{
glClear( GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glVertex3f(2.0, 4.0, 0.0);
glVertex3f(8.0, 4.0, 0.0);
glVertex3f(8.0, 6.0, 0.0);
glVertex3f(2.0, 6.0, 0.0);
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
printf("hello world\n");
glutInit(&argc, argv);
glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(100,100);
glutInitWindowSize(300,300);
glutCreateWindow ("square");
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 10.0, 0.0, 10.0, -1.0, 1.0);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
test_tut.exe - 0 error(s), 0 warning(s)
.bsc | Browse information file. This information is used to provide information such as where a symbol is first defined or referenced. It is produced from the .sbr file. |
.dsw | Project workspace file. Stores information at the workspace level. Other associated files are also created, including a project file (.dsp) for building a single project or subproject, and a workspace options file (.opt) to store project workspace settings. |
.dsp | Project file. See .dsw. |
.exe | Program executable |
.ilk | Incremental link file. Stores information required for incremental linking. |
.ncb | Network control block (?). Purpose ? |
.obj | Object files. Equivalent to unix '.o' files. |
.opt | Workspace options file. Contains local cosmetic settings, which include information about the local organization and appearance of the project workspace using your hardware and configuration. |
.pch | pre-compiled headers for the project, which allows for faster compiles |
.pdb | Program database. Holds debugging and project state information. Provides the information needed for incremental linking of debug program versions. |
.plg | ?? |
.sbr | Stores symbolic information about each .obj file. |
vc50.idb | incremental information for vc50.pdb (?) |
vc50.pdb | Stores all debugging information for the individual .obj files. |
all: $(PROGRAM)
########### list of C++ source files
CPPSRCS = \
main.cpp
########## list of C source files
CSRCS =
########### libraries to link with
LIBS = \
kernel32.lib \
user32.lib \
gdi32.lib \
winspool.lib \
comdlg32.lib \
advapi32.lib \
shell32.lib \
ole32.lib \
oleaut32.lib \
uuid.lib \
odbc32.lib \
odbccp32.lib \
opengl32.lib \
msvcrt.lib \
glut32.lib
########### these details may differ on your machine
inc32 = "c:\Program Files\DevStudio\VC\include"
cc32 = "c:\Program Files\DevStudio\VC\bin\cl.exe"
link32 = "c:\Program Files\DevStudio\VC\bin\link.exe"
linkflags= \
/nologo /subsystem:console /incremental:yes\
/pdb:"Debug/sq.pdb" /debug /machine:I386 /pdbtype:sept \
/out:"Debug/sq.exe" /nodefaultlib:libcd
LIB = "c:\Program Files\DevStudio\VC\lib"
INCLUDE = -I $(inc32) -I .
CPPFLAGS = -nologo -MLd -W3 -Gm -GX -Zi -Od -D "WIN32" -D "_DEBUG"
\
-D "_WIN32" -D "_MT" -D "_DLL"
-D "_X86" \
-Fp"Gls.pch" -YX -FD -c
########### build a list of all .obj files
OBJS = $(CPPSRCS:.cpp=.obj) $(CSRCS:.c=.obj)
########### how to link .obj files to create an executable
$(PROGRAM): $(OBJS)
$(link32) -out:$@ $(OBJS) $(LIBS) $(linkflags)
########### how to create .obj files from .c files (ANSI C)
.c.obj:
$(cc32) $(CPPFLAGS) $(INCLUDE) $*.c
########### how to create .obj files from .cpp files (ANSI C++)
.cpp.obj:
$(cc32) $(CPPFLAGS) $(INCLUDE) $*.cpp
########### delete .obj and .exe files
clean:
del $(PROGRAM) *.obj Debug\*.obj