Made the pointer-ness of object handles explicit.

This commit is contained in:
Camilla Berglund
2013-01-05 21:13:28 +01:00
parent fc79e0a3a8
commit 9af960e2dd
32 changed files with 246 additions and 245 deletions
+3 -3
View File
@@ -42,7 +42,7 @@
/* Prototypes */
void init( void );
void display( void );
void reshape( GLFWwindow window, int w, int h );
void reshape( GLFWwindow* window, int w, int h );
void DrawBoingBall( void );
void BounceBall( double dt );
void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
@@ -224,7 +224,7 @@ void display(void)
/*****************************************************************************
* reshape()
*****************************************************************************/
void reshape( GLFWwindow window, int w, int h )
void reshape( GLFWwindow* window, int w, int h )
{
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
@@ -567,7 +567,7 @@ void DrawGrid( void )
int main( void )
{
GLFWwindow window;
GLFWwindow* window;
int width, height;
/* Init GLFW */
+4 -4
View File
@@ -215,7 +215,7 @@ static void animate(void)
/* change view angle, exit upon ESC */
void key( GLFWwindow window, int k, int action )
void key( GLFWwindow* window, int k, int action )
{
if( action != GLFW_PRESS ) return;
@@ -248,7 +248,7 @@ void key( GLFWwindow window, int k, int action )
/* new window size */
void reshape( GLFWwindow window, int width, int height )
void reshape( GLFWwindow* window, int width, int height )
{
GLfloat h = (GLfloat) height / (GLfloat) width;
GLfloat xmax, znear, zfar;
@@ -268,7 +268,7 @@ void reshape( GLFWwindow window, int width, int height )
/* close callback */
static int window_close_callback(GLFWwindow window)
static int window_close_callback(GLFWwindow* window)
{
running = 0;
return GL_TRUE;
@@ -329,7 +329,7 @@ static void init(int argc, char *argv[])
/* program entry */
int main(int argc, char *argv[])
{
GLFWwindow window;
GLFWwindow* window;
int width, height;
if( !glfwInit() )
+3 -3
View File
@@ -484,7 +484,7 @@ static void update_mesh(void)
static GLboolean running = GL_TRUE;
/* GLFW Window management functions */
static int window_close_callback(GLFWwindow window)
static int window_close_callback(GLFWwindow* window)
{
running = GL_FALSE;
@@ -493,7 +493,7 @@ static int window_close_callback(GLFWwindow window)
return 0;
}
static void key_callback(GLFWwindow window, int key, int action)
static void key_callback(GLFWwindow* window, int key, int action)
{
switch(key)
{
@@ -513,7 +513,7 @@ static void usage(void)
int main(int argc, char** argv)
{
GLFWwindow window;
GLFWwindow* window;
int ch, iter;
double dt;
double last_update_time;
+5 -5
View File
@@ -357,7 +357,7 @@ static void drawAllViews(void)
// Window size callback function
//========================================================================
static void windowSizeFun(GLFWwindow window, int w, int h)
static void windowSizeFun(GLFWwindow* window, int w, int h)
{
width = w;
height = h > 0 ? h : 1;
@@ -369,7 +369,7 @@ static void windowSizeFun(GLFWwindow window, int w, int h)
// Window refresh callback function
//========================================================================
static void windowRefreshFun(GLFWwindow window)
static void windowRefreshFun(GLFWwindow* window)
{
do_redraw = 1;
}
@@ -379,7 +379,7 @@ static void windowRefreshFun(GLFWwindow window)
// Mouse position callback function
//========================================================================
static void cursorPosFun(GLFWwindow window, int x, int y)
static void cursorPosFun(GLFWwindow* window, int x, int y)
{
// Depending on which view was selected, rotate around different axes
switch (active_view)
@@ -414,7 +414,7 @@ static void cursorPosFun(GLFWwindow window, int x, int y)
// Mouse button callback function
//========================================================================
static void mouseButtonFun(GLFWwindow window, int button, int action)
static void mouseButtonFun(GLFWwindow* window, int button, int action)
{
if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS)
{
@@ -441,7 +441,7 @@ static void mouseButtonFun(GLFWwindow window, int button, int action)
int main(void)
{
GLFWwindow window;
GLFWwindow* window;
// Initialise GLFW
if (!glfwInit())
+1 -1
View File
@@ -18,7 +18,7 @@ static void error_callback(int error, const char* description)
int main(void)
{
int width, height, x;
GLFWwindow window;
GLFWwindow* window;
glfwSetErrorCallback(error_callback);
+8 -8
View File
@@ -145,7 +145,7 @@ void init_grid(void)
// Draw scene
//========================================================================
void draw_scene(GLFWwindow window)
void draw_scene(GLFWwindow* window)
{
// Clear the color and depth buffers
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -271,7 +271,7 @@ static void error_callback(int error, const char* description)
// Handle key strokes
//========================================================================
void key_callback(GLFWwindow window, int key, int action)
void key_callback(GLFWwindow* window, int key, int action)
{
if (action != GLFW_PRESS)
return;
@@ -314,7 +314,7 @@ void key_callback(GLFWwindow window, int key, int action)
// Callback function for mouse button events
//========================================================================
void mouse_button_callback(GLFWwindow window, int button, int action)
void mouse_button_callback(GLFWwindow* window, int button, int action)
{
if (button != GLFW_MOUSE_BUTTON_LEFT)
return;
@@ -336,7 +336,7 @@ void mouse_button_callback(GLFWwindow window, int button, int action)
// Callback function for cursor motion events
//========================================================================
void cursor_position_callback(GLFWwindow window, int x, int y)
void cursor_position_callback(GLFWwindow* window, int x, int y)
{
if (locked)
{
@@ -353,7 +353,7 @@ void cursor_position_callback(GLFWwindow window, int x, int y)
// Callback function for scroll events
//========================================================================
void scroll_callback(GLFWwindow window, double x, double y)
void scroll_callback(GLFWwindow* window, double x, double y)
{
zoom += (float) y / 4.f;
if (zoom < 0)
@@ -365,7 +365,7 @@ void scroll_callback(GLFWwindow window, double x, double y)
// Callback function for window resize events
//========================================================================
void window_size_callback(GLFWwindow window, int width, int height)
void window_size_callback(GLFWwindow* window, int width, int height)
{
float ratio = 1.f;
@@ -386,7 +386,7 @@ void window_size_callback(GLFWwindow window, int width, int height)
// Callback function for window close events
//========================================================================
static int window_close_callback(GLFWwindow window)
static int window_close_callback(GLFWwindow* window)
{
running = GL_FALSE;
return GL_TRUE;
@@ -399,7 +399,7 @@ static int window_close_callback(GLFWwindow window)
int main(int argc, char* argv[])
{
GLFWwindow window;
GLFWwindow* window;
double t, dt_total, t_old;
int width, height;