コード例 #1
0
ファイル: EAGLView.cpp プロジェクト: mickeprag/hex-game
void EAGLView::initializeGL() {
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0, this->width(), this->height(), 0, -1, 1);
	
	glMatrixMode(GL_MODELVIEW);
	
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glEnable(GL_TEXTURE_2D);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
	
	glDisable(GL_DEPTH_TEST);
	glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
	
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	
    TextureCatalog::instance();

    ResourceLoader resourceLoader(this);
    resourceLoader.load();

	d->centralControl = CentralControl::instance();
	d->timer.start();
}
コード例 #2
0
void WebResourceLoader::didReceiveResponseWithCertificateInfo(const ResourceResponse& response, const CertificateInfo& certificateInfo, bool needsContinueDidReceiveResponseMessage)
{
    LOG(Network, "(WebProcess) WebResourceLoader::didReceiveResponseWithCertificateInfo for '%s'. Status %d.", m_coreLoader->url().string().utf8().data(), response.httpStatusCode());

    Ref<WebResourceLoader> protect(*this);

    ResourceResponse responseCopy(response);

#if USE(QUICK_LOOK)
    m_quickLookHandle = QuickLookHandle::create(resourceLoader(), response.nsURLResponse());
    if (m_quickLookHandle)
        responseCopy = ResourceResponse(m_quickLookHandle->nsResponse());
#endif

    // FIXME: This should use CertificateInfo to avoid the platform ifdefs. See https://bugs.webkit.org/show_bug.cgi?id=124724.
#if PLATFORM(COCOA)
    responseCopy.setCertificateChain(certificateInfo.certificateChain());
#elif USE(SOUP)
    responseCopy.setSoupMessageCertificate(certificateInfo.certificate());
    responseCopy.setSoupMessageTLSErrors(certificateInfo.tlsErrors());
#endif
    if (m_coreLoader->documentLoader()->applicationCacheHost()->maybeLoadFallbackForResponse(m_coreLoader.get(), responseCopy))
        return;
    m_coreLoader->didReceiveResponse(responseCopy);

    // If m_coreLoader becomes null as a result of the didReceiveResponse callback, we can't use the send function(). 
    if (!m_coreLoader)
        return;

    if (needsContinueDidReceiveResponseMessage)
        send(Messages::NetworkResourceLoader::ContinueDidReceiveResponse());
}
コード例 #3
0
ファイル: vncviewer.cpp プロジェクト: kaseya/tightvnc2
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
#endif
{
  //
  // FIXME: Resource loader owner must be Application class
  // or something like this. Instanize resourse loader here
  // is not good way.
  //

  ResourceLoader resourceLoader(hInstance);
  VncViewerConfig config;

	// The state of the application as a whole is contained in the one app object
	#ifdef _WIN32_WCE
		VNCviewerApp app(hInstance, szCmdLine);
	#else
		VNCviewerApp32 app(hInstance, szCmdLine);
	#endif

	// Start a new connection if specified on command line, 
	// or if not in listening mode
	
	if (app.m_options.m_connectionSpecified) {
		app.NewConnection(app.m_options.m_host, app.m_options.m_port);
	} else if (!app.m_options.m_listening) {
		// This one will also read from config file if specified
		app.NewConnection();
	}

	MSG msg;
	std::list<HWND>::iterator iter;

	try {
		while (GetMessageW(&msg, NULL, 0, 0)) {
			if ( !hotkeys.TranslateAccel(&msg) &&
				 !help.TranslateMsg(&msg) &&
				 !app.ProcessDialogMessage(&msg) ) {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}
	} catch (WarningException &e) {
		e.Report();
	} catch (QuietException &e) {
		e.Report();
	}
	
	// Clean up winsock
	WSACleanup();

    Log::warning(_T("Exiting\n"));

	return msg.wParam;
}
コード例 #4
0
bool WebResourceLoader::isAlwaysOnLoggingAllowed() const
{
    return resourceLoader() && resourceLoader()->isAlwaysOnLoggingAllowed();
}
コード例 #5
0
ファイル: main.cpp プロジェクト: gwupe/GwupeSupportScreen
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE,
                       LPTSTR lpCmdLine, int nCmdShow)
{
  ViewerSettingsManager::initInstance(RegistryPaths::VIEWER_PATH);
  SettingsManager *sm = ViewerSettingsManager::getInstance();

  ViewerConfig config(RegistryPaths::VIEWER_PATH);
  config.loadFromStorage(sm);

  try {
    config.initLog(LogNames::LOG_DIR_NAME, LogNames::VIEWER_LOG_FILE_STUB_NAME);
  } catch (...) {
  }

  LogWriter logWriter(config.getLogger());

  // resource-loader initialization
  ResourceLoader resourceLoader(hInstance);

  logWriter.debug(_T("main()"));
  logWriter.debug(_T("loading settings from storage completed"));
  logWriter.debug(_T("Log initialization completed"));

  ConnectionConfig conConf;
  ConnectionData condata;
  bool isListening = false;
  ViewerCmdLine cmd(&condata, &conConf, &config, &isListening);

  int result = 0;
  try {
    cmd.parse();
    TvnViewer tvnViewer(hInstance,
                        ApplicationNames::WINDOW_CLASS_NAME,
                        WindowNames::TVN_WINDOW_CLASS_NAME);
    if (isListening) {
      // FIXME: set listening connection options.
      tvnViewer.startListening(ConnectionListener::DEFAULT_PORT);
    } else if (!condata.isEmpty()) {
      tvnViewer.newConnection(&condata, &conConf);
    } else {
      tvnViewer.showLoginDialog();
    }
    result = tvnViewer.run();
  } catch (const CommandLineFormatException &exception) {
    StringStorage strError(exception.getMessage());
    MessageBox(0,
               strError.getString(),
               ProductNames::VIEWER_PRODUCT_NAME,
               MB_OK | MB_ICONERROR);
    return 0;
  } catch (const CommandLineFormatHelp &) {
    cmd.onHelp();
    return 0;
  } catch (const Exception &ex) {
    MessageBox(0,
               StringTable::getString(IDS_UNKNOWN_ERROR_IN_VIEWER),
               ProductNames::VIEWER_PRODUCT_NAME,
               MB_OK | MB_ICONERROR);
    logWriter.debug(ex.getMessage());
  }

  return result;
}