init commit
This commit is contained in:
BIN
c_graphics/sample/demo
Executable file
BIN
c_graphics/sample/demo
Executable file
Binary file not shown.
24
c_graphics/sample/demo.c
Normal file
24
c_graphics/sample/demo.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* demo.c*/
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glu.h>
|
||||
void setup() { glClearColor(1.0f, 1.0f, 1.0f, 1.0f); }
|
||||
void display()
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glColor3f(0.0f, 0.0f, 0.0f);
|
||||
glRectf(-0.75f,0.75f, 0.75f, -0.75f);
|
||||
glutSwapBuffers();
|
||||
}
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
|
||||
glutInitWindowSize(800,600);
|
||||
glutCreateWindow("Hello World");
|
||||
|
||||
setup();
|
||||
glutDisplayFunc(display);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
14
c_graphics/sample/test.c
Normal file
14
c_graphics/sample/test.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include<graphics.h>
|
||||
#include<conio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int gd = DETECT, gm;
|
||||
|
||||
initgraph(&gd, &gm, "C:\\TC\\BGI");
|
||||
|
||||
getch();
|
||||
closegraph();
|
||||
return0
|
||||
}
|
||||
|
Reference in New Issue
Block a user