示例#1
0
void VID_Init(void)
{
    WNDCLASSEX wc = { 0 };
    wc.cbSize = sizeof(wc);
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = GlobalInstance;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.lpszClassName = "Module 3";

    if (!RegisterClassEx(&wc))
        exit(EXIT_FAILURE);

    VID_InitWindowedMode();
    VID_InitFullscreenMode();

    VID_SetMode(0);
}
示例#2
0
void VID_Init(void)
{

	WNDCLASSEX wc = { 0 };
	wc.cbSize = sizeof(wc);

	wc.lpfnWndProc = MainWndProc;											// message handling callback function
	wc.hInstance = GlobalInstance;
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.lpszClassName = L"Module 3";

	//RegisterClassEx(&wc);

	if (!RegisterClassEx(&wc))
		exit(EXIT_FAILURE);

	int32 PaletteLength = 0;
	int8  *PaletteData = COM_FindFile("gfx/palette.lmp", &PaletteLength);
	
	uint8 *PaletteWalker = PaletteData;
	for (int i = 0; i < 256; i++)
	{
		uint8 Red = *PaletteWalker++;
		uint8 Green = *PaletteWalker++;
		uint8 Blue = *PaletteWalker++;

		uint32 Color = ((Red << 16) | (Green << 8) | Blue);
		ColorArray[i] = Color;
	}
	free(PaletteData);

	Vid.ColorPointer = ColorArray;
	
	VID_InitWindowedMode();
	VID_InitFullScreenMode();

	VID_SetMode(0);
}