📄 gstest.c
字号:
/* gstest.c */
/* this file is an example of using a task to capture and dispatch
events.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nucleus.h"
/*
Change To Allow The getch() Function To Be Included In The Source Code Without
Compiling. The Windowing Code Uses The getch() Function To Create A Pause
Whenever An Error Occurs. This Change Will Cause The Error To Be Processed
Without A Pause.
03-25-98 Mike Butler
*/
#ifndef getch
int getch(void)
{
return (0);
}
#endif
void StartGUI(void);
void InitGUI(void);
NU_MEMORY_POOL System_Memory;
/* ---------------- RGB Palette Programming ---------------- */
typedef struct _palData /* Palette data structure */
{unsigned short palRed; /* red intensity */
unsigned short palGreen; /* green intensity */
unsigned short palBlue; /* blue intensity */
} palData;
palData RGBdata[256];
void Application_Initialize(void *first_available_memory)
{
/* Create a system memory pool that will be used to allocate task stacks,
queue areas, etc. */
NU_Create_Memory_Pool(&System_Memory, "SYSMEM",
first_available_memory, 1600000, 50, NU_FIFO);
StartGUI();
}
void* mcMalloc( unsigned int size )
{
void *address;
int status;
status = NU_Allocate_Memory( &System_Memory, &address, size, 0 );
return(address);
}
void mcFree( void *address )
{
NU_Deallocate_Memory( address );
}
void StartGUI(void)
{
char buf[50];
int grafixCard;
grafixCard = InitGraphics(0x103);
while(1)
{
mwstart1();
mwfont();
mappoly();
dashtest();
offscreen();
blittest();
bezier();
animpoly();
hilbert();
clockP();
demoport();
pattern();
}
}
void Waiting(int a)
{
short x,y;
for(x = 0; x < a; x++)
for(y = 0; y < 3000; y++);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -