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

Skript und Übersichtsdatei (README.md)

parent c88d1473
No related branches found
No related tags found
No related merge requests found
Showing with 287 additions and 0 deletions
#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 <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 ();
glTranslatef (0.9, 0.0, 0.0);
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 <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);
glTranslatef (0.9, 0.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;
}
../common/earth-texture.png
\ No newline at end of file
#include <stdio.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
fprintf (f, "Hello, world!\n");
fclose (f);
return 0;
}
#include <stdio.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
if (f)
{
fprintf (f, "Hello, world!\n");
fclose (f);
}
return 0;
}
#include <stdio.h>
#include <errno.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
if (f)
{
fprintf (f, "Hello, world!\n");
fclose (f);
}
else
fprintf (stderr, "error #%d\n", errno);
return 0;
}
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
if (f)
{
fprintf (f, "Hello, world!\n");
fclose (f);
}
else
{
char *msg = strerror (errno);
fprintf (stderr, "%s\n", msg);
}
return 0;
}
#include <stdio.h>
#include <errno.h>
#include <error.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
if (!f)
error (1, errno, "cannot open file");
fprintf (f, "Hello, world!\n");
fclose (f);
return 0;
}
#include <stdio.h>
#include <errno.h>
#include <error.h>
int main (void)
{
FILE *f = fopen ("fhello.txt", "w");
if (!f)
error (errno, errno, "cannot open file");
fprintf (f, "Hello, world!\n");
fclose (f);
return 0;
}
#include <stdio.h>
void foo (int a, int b)
{
printf ("foo(): a = %d, b = %d\n", a, b);
}
int main (void)
{
foo (3, 7);
return 0;
}
#include <stdio.h>
int a, b = 3;
void foo (void)
{
b++;
static int a = 5;
int b = 7;
printf ("foo(): a = %d, b = %d\n", a, b);
a++;
b++;
}
int main (void)
{
printf ("main(): a = %d, b = %d\n", a, b);
foo ();
printf ("main(): a = %d, b = %d\n", a, b);
a = b = 12;
printf ("main(): a = %d, b = %d\n", a, b);
foo ();
printf ("main(): a = %d, b = %d\n", a, b);
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
"\n";
return 0;
}
eine kleine Hexe.
#include <stdio.h>
#define VIER 4
int main (void)
{
printf ("2 + 2 = %d\n", VIER);
return 0;
}
#include <stdio.h>
#define wuppdich printf
#define holla main
#define pruzzel return
#define VIER 4
int holla (void)
{
wuppdich ("2 + 2 = %d\n", VIER);
pruzzel 0;
}
#include <stdio.h>
#define VIER 2 + 2
int main (void)
{
printf ("2 + 3 * 4 = %d\n", 2 + 3 * VIER);
return 0;
}
#include <stdio.h>
#define VIER (2 + 2)
int main (void)
{
printf ("2 + 3 * 4 = %d\n", 2 + 3 * VIER);
return 0;
}
#include <stdio.h>
#define VIER (2 + 2));
int main (void)
{
printf ("2 + 3 * 4 = %d\n", 2 + 3 * VIER
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment