Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5098 → Rev 5097

/programs/demos/cubeline/trunk/main.cpp
16,10 → 16,10
 
int Fps (long x, long y);
extern "C"{
int main(void);
void app_main(void);
}
 
static struct {
struct {
int x,y;
int dx,dy;
} win;
29,19 → 29,19
#define KEY_ESC 1
#define KEY_F 33
 
static char title1[] = "TinyGL in KolibriOS";
static char title2[] = "F full screen";
static char title3[] = "ESC - exit";
static char fps[] = "FPS:";
char *title1 = "TinyGL in KolibriOS";
char *title2 = "F full screen";
char *title3 = "ESC - exit";
char *fps = "FPS:";
 
static unsigned char FullScreen = 0;
static unsigned char skin = 3;
unsigned char FullScreen = 0;
unsigned char skin = 3;
 
static float angle;
static process_table_entry_* pri;
static KOSGLContext cgl;
float angle;
process_table_entry_* pri;
KOSGLContext cgl;
 
static void draw_cube()
void draw_cube()
{
float x,y,z;
glBegin(GL_LINES);
130,7 → 130,7
glEnd();
}
 
static void DrawGL()
void DrawGL()
{
glLoadIdentity(); // óñòàíàâëèâàåì åäåíè÷íóþ ìàòðèöó
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
145,7 → 145,7
kosglSwapBuffers();
}
 
static void reshape()
void reshape()
{
__menuet__get_process_table((process_table_entry*)pri,-1);
glViewport(0, 0, pri->winx_size, pri->winy_size-20);
156,13 → 156,13
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
}
 
static void disabletgl()
void disabletgl()
{
kosglDestroyContext(cgl);
delete pri;
}
 
static void Title()
void Title()
{
__menuet__write_text(300,8,0x10ffffff,fps,strlen(fps));
__menuet__write_text(8,8,0x10ffffff,title1,strlen(title1));
170,7 → 170,7
__menuet__write_text(600,8,0x00ffffff,title3,strlen(title3));
}
 
static void draw_window(void)
void draw_window(void)
{
// start redraw
__menuet__window_redraw(1);
182,7 → 182,7
Title();
}
 
int main(void)
void app_main(void)
{
win.x = 100;
241,11 → 241,11
break;
case KEY_ESC: disabletgl();
return 0;}
return;}
break;
case 3: disabletgl();
return 0;
return;
}
}while(1);
}