Ejemplo n.º 1
0
/*
* MainInit:  Called when main window is created.
*/
BOOL MainInit(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
{
	connection = CON_NONE;
	state = STATE_INIT;
	
	/* Verify that user's hardware is sufficient to run game */
	if (!StartupCheck())
		exit(1); 
	
	/* Make standard palette */
	hPal = InitializePalette();
	InitStandardXlats(hPal);
	
	LoadSettings();
	MenuDisplaySettings(hwnd);
	
	// Load rich edit control DLL and common controls
	hRichEditLib = LoadLibrary("riched32.dll");
	InitCommonControls();
	
	MusicInitialize();
	
	SetMainCursor(LoadCursor(NULL, IDC_ARROW));
	
	// Find default Web browser, if not set manually
	if (config.default_browser)
		WebFindDefaultBrowser();
	
	return TRUE;
}
Ejemplo n.º 2
0
void wxWindowDCImpl::InitDC()
{
    // the background mode is only used for text background and is set in
    // DrawText() to OPAQUE as required, otherwise always TRANSPARENT,
    ::SetBkMode(GetHdc(), TRANSPARENT);

    // since we are a window dc we need to grab the palette from the window
#if wxUSE_PALETTE
    InitializePalette();
#endif
}
Ejemplo n.º 3
0
/*
 * @implemented
 */
VOID
NTAPI
VidResetDisplay(IN BOOLEAN HalReset)
{
    /* Clear the current position */
    curr_x = 0;
    curr_y = 0;

    /* Clear the screen with HAL if we were asked to */
    if (HalReset) HalResetDisplay();

    /* Re-initialize the VGA Display */
    VgaInterpretCmdStream(AT_Initialization);

    /* Re-initialize the palette and fill the screen black */
    InitializePalette();
    VidSolidColorFill(0, 0, 639, 479, 0);
}
Ejemplo n.º 4
0
void NaGsView::InitGL() 
{
	int nPixelFormat = 0;					// Pixel format index
	m_hDC = m_ptrWnd->GetDC()->m_hDC;		// Get the Device context

	static PIXELFORMATDESCRIPTOR pfd = {
		sizeof(PIXELFORMATDESCRIPTOR),	// Size of this structure
		1,								// Version of this structure	
		PFD_DRAW_TO_WINDOW |			// Draw to Window (not to bitmap)
		PFD_SUPPORT_OPENGL |			// Support OpenGL calls in window
		PFD_DOUBLEBUFFER,				// Double buffered mode
		PFD_TYPE_RGBA,					// RGBA Color mode
		24,								// Want 24bit color 
		0,0,0,0,0,0,					// Not used to m_select mode
		0,0,							// Not used to m_select mode
		0,0,0,0,0,						// Not used to m_select mode
		32,								// Size of depth buffer
		0,								// Not used to m_select mode
		0,								// Not used to m_select mode
		PFD_MAIN_PLANE,					// Draw in main plane
		0,								// Not used to m_select mode
		0,0,0 };						// Not used to m_select mode

	OSVERSIONINFO osvi = { 0 };

	pfd.nSize = sizeof(pfd);
	pfd.nVersion = 1;
	pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
	pfd.iPixelType = PFD_TYPE_RGBA;
	pfd.cColorBits = 24;
	pfd.cDepthBits = 16;
	pfd.iLayerType = PFD_MAIN_PLANE;

	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
	if (!GetVersionEx(&osvi))
		throw std::runtime_error("InitGL() failed.");

	// 윈도우 비스타 이후 버전에서 지원
	if (osvi.dwMajorVersion > 6 || (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion >= 0))
		pfd.dwFlags |= PFD_SUPPORT_COMPOSITION;

	//
	ChooseBestMultiSampleAntiAliasingPixelFormat(nPixelFormat, m_msaaSamples);

	//DC의 필셀 포멧 디스크립션 
	if (!nPixelFormat)
		nPixelFormat = ChoosePixelFormat(m_hDC, &pfd);

	//디바이스 컨텍스트 에 대한픽셀 포맷 을 설정할
	if (!SetPixelFormat(m_hDC, nPixelFormat, &pfd))
		throw std::runtime_error("SetPixelFormat() failed.");

	//렌더링 컨텍스트 구성
	if (!(m_hRC = wglCreateContext(m_hDC)))
		throw std::runtime_error("wglCreateContext() failed.");

	//렌더링 컨텍스트를 확인 , 초기화를 수행 한 후 선택을 해제
	if (!wglMakeCurrent(m_hDC, m_hRC))
		throw std::runtime_error("wglMakeCurrent() failed.");

	//NAKGs모듈의 함수를 호출하여 텍스쳐 정보를 설정함
	InitGsModule(m_hDC, m_hRC);

	glClearColor(m_bkRed, m_bkGreen, m_bkBlue, 1.0);

	wglMakeCurrent(m_hDC, NULL);

	// Create the palette if needed
	InitializePalette();
}