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

Beispielprogramme 6.11.2017

parent 58aee1f1
No related branches found
No related tags found
No related merge requests found
#include "answer.h"
int answer (void)
{
return 23;
}
extern int answer (void);
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "opengl-magic.h"
void draw (void)
{
glClear (GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT);
set_material_color (1.0, 0.7, 0.0);
glutSolidCube (0.75);
glFlush ();
glutSwapBuffers ();
}
int main (int argc, char **argv)
{
init_opengl (&argc, argv, "Cube");
glutDisplayFunc (draw);
glutMainLoop ();
return 0;
}
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "opengl-magic.h"
void draw (void)
{
glClear (GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT);
set_material_color (1.0, 0.7, 0.0);
glRotatef (-30.0, 0.5, 1.0, 0.0);
glutSolidCube (0.75);
glFlush ();
glutSwapBuffers ();
}
int main (int argc, char **argv)
{
init_opengl (&argc, argv, "Cube");
glutDisplayFunc (draw);
glutMainLoop ();
return 0;
}
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "opengl-magic.h"
float t = 0.0;
void draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
set_material_color (1.0, 0.7, 0.0);
glRotatef (t, 0.5, 1.0, 0.0);
glutSolidCube (0.5);
glFlush ();
glutSwapBuffers ();
}
void timer_handler (int value)
{
t += 0.05;
glutPostRedisplay ();
glutTimerFunc (50, timer_handler, 0);
}
int main (int argc, char **argv)
{
init_opengl (&argc, argv, "Cube");
glutDisplayFunc (draw);
glutTimerFunc (50, timer_handler, 0);
glutMainLoop ();
return 0;
}
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "opengl-magic.h"
float t = 0.0;
void draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
set_material_color (1.0, 0.7, 0.0);
glPushMatrix ();
glRotatef (t, 0.5, 1.0, 0.0);
glutSolidCube (0.5);
glPopMatrix ();
glFlush ();
glutSwapBuffers ();
}
void timer_handler (int value)
{
t += 0.05;
glutPostRedisplay ();
glutTimerFunc (50, timer_handler, 0);
}
int main (int argc, char **argv)
{
init_opengl (&argc, argv, "Cube");
glutDisplayFunc (draw);
glutTimerFunc (50, timer_handler, 0);
glutMainLoop ();
return 0;
}
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "opengl-magic.h"
float t = 0.0;
void draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
set_material_color (1.0, 0.7, 0.0);
glPushMatrix ();
glRotatef (20.0 * t, 0.5, 1.0, 0.0);
glutSolidCube (0.5);
glPopMatrix ();
glFlush ();
glutSwapBuffers ();
}
void timer_handler (int value)
{
t += 0.05;
glutPostRedisplay ();
glutTimerFunc (50, timer_handler, 0);
}
int main (int argc, char **argv)
{
init_opengl (&argc, argv, "Cube");
glutDisplayFunc (draw);
glutTimerFunc (50, timer_handler, 0);
glutMainLoop ();
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
extern int printf (const char *__restrict __format, ...);
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
#include "stdio.h"
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
eine kleine Hexe.
Vor langer, langer Zeit
gab es einmal
#include "hexe.h"
Die lebte in einem Wald.
#include <stdio.h>
#include "answer.h"
int main (void)
{
printf ("The answer is %d.\n", answer ());
return 0;
}
extern int printf (const char *__restrict __format, ...);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment