git.ucc.asn.au
/
atyndall
/
cits2231.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1974078
)
(no commit message)
author
Ash Tyndall
<
[email protected]
>
Sun, 9 Oct 2011 05:41:51 +0000
(13:41 +0800)
committer
Ash Tyndall
<
[email protected]
>
Sun, 9 Oct 2011 05:41:51 +0000
(13:41 +0800)
scene.c
patch
|
blob
|
history
diff --git
a/scene.c
b/scene.c
index
c546975
..
0590299
100644
(file)
--- a/
scene.c
+++ b/
scene.c
@@
-460,6
+460,26
@@
void makeMenu() {
glutAttachMenu(GLUT_RIGHT_BUTTON);
\r
}
\r
\r
glutAttachMenu(GLUT_RIGHT_BUTTON);
\r
}
\r
\r
+/**
\r
+ * Called when window is resized
\r
+ * @param w New width
\r
+ * @param h New height
\r
+ */
\r
+void windowReshape(int w, int h) {
\r
+
\r
+}
\r
+
\r
+/**
\r
+ * Called when mouse event occurs
\r
+ * @param btn Mouse button
\r
+ * @param state State of mouse button
\r
+ * @param x Mouse x position
\r
+ * @param y Mouse y position
\r
+ */
\r
+void mouse(int btn, int state, int x, int y) {
\r
+
\r
+}
\r
+
\r
/**
\r
* Display function
\r
*/
\r
/**
\r
* Display function
\r
*/
\r
@@
-488,12
+508,15
@@
int main(int argc, char **argv) {
for(int i=0; i<NMESH; i++) meshes[i]=NULL;
\r
for(int i=0; i<NTEXTURE; i++) textures[i]=NULL;
\r
\r
for(int i=0; i<NMESH; i++) meshes[i]=NULL;
\r
for(int i=0; i<NTEXTURE; i++) textures[i]=NULL;
\r
\r
- // The following is enough to run the program, but you'll
\r
- // need to change it significantly.
\r
-
\r
glutInit(&argc, argv);
\r
glutInit(&argc, argv);
\r
+
\r
+ glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
\r
+ glutInitWindowSize(500, 500);
\r
glutCreateWindow("Scene Editor");
\r
glutCreateWindow("Scene Editor");
\r
+ glutReshapeFunc(windowReshape);
\r
glutDisplayFunc(display);
\r
glutDisplayFunc(display);
\r
+ glutMouseFunc(mouse);
\r
+ glEnable(GL_DEPTH_TEST); // Enable hidden surface removal
\r
\r
makeMenu();
\r
glutMainLoop();
\r
\r
makeMenu();
\r
glutMainLoop();
\r
UCC
git Repository :: git.ucc.asn.au