Skip to content
Snippets Groups Projects
Commit f11c50e1 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

opengl-magic.[ch]: glutSolidCylinder für MacOS

parent 3f5e907b
Branches
No related tags found
No related merge requests found
#if defined(__APPLE__) || defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif
#include "opengl-magic.h"
void init_opengl (int *argcp, char **argv, char *window_name)
......@@ -29,3 +36,14 @@ void set_material_color (float r, float g, float b)
glMaterialfv (GL_FRONT, GL_AMBIENT, color);
glMaterialfv (GL_FRONT, GL_DIFFUSE, color);
}
#if defined(__APPLE__) || defined(MACOSX)
void glutSolidCylinder (double radius, double height, int slices, int stacks)
{
GLUquadricObj *q = gluNewQuadric ();
gluCylinder (q, radius, radius, height, slices, stacks);
gluDeleteQuadric (q);
}
#endif
#ifndef OPENGL_MAGIC_H
#define OPENGL_MAGIC_H
extern void init_opengl (int *argcp, char **argv, char *window_name);
extern void set_material_color (float r, float g, float b);
#ifdef __MACOSX__
extern void glutSolidCylinder (double radius, double height, int slices, int stacks);
#endif
#endif /* OPENGL_MAGIC_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment