bool begin() { bool Success(true); // Validate OpenGL support Success = Success && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Success = Success && glf::checkExtension("GL_ARB_multi_draw_indirect"); // Create and initialize objects if(Success && glf::checkExtension("GL_ARB_debug_output")) Success = initDebugOutput(); if(Success) Success = initProgram(); if(Success) Success = initBuffer(); if(Success) Success = initVertexArray(); if(Success) Success = initTexture(); // Set initial rendering states glEnable(GL_DEPTH_TEST); glViewportIndexedfv(0, &glm::vec4(0, 0, Window.Size.x, Window.Size.y)[0]); glBindProgramPipeline(PipelineName); glBindVertexArray(VertexArrayName); glBindBufferBase(GL_UNIFORM_BUFFER, glf::semantic::uniform::TRANSFORM0, BufferName[buffer::TRANSFORM]); glBindBufferBase(GL_UNIFORM_BUFFER, glf::semantic::uniform::INDIRECTION, BufferName[buffer::VERTEX_INDIRECTION]); glProvokingVertex(GL_FIRST_VERTEX_CONVENTION); return Success; }
bool begin() { glm::vec2 ViewportSize(Window.Size.x * 0.33f, Window.Size.y * 0.50f); Viewport[viewport::VIEWPORT0] = glm::vec4(ViewportSize.x * 0.0f, ViewportSize.y * 0.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); Viewport[viewport::VIEWPORT1] = glm::vec4(ViewportSize.x * 1.0f, ViewportSize.y * 0.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); Viewport[viewport::VIEWPORT2] = glm::vec4(ViewportSize.x * 2.0f, ViewportSize.y * 0.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); Viewport[viewport::VIEWPORT3] = glm::vec4(ViewportSize.x * 0.0f, ViewportSize.y * 1.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); Viewport[viewport::VIEWPORT4] = glm::vec4(ViewportSize.x * 1.0f, ViewportSize.y * 1.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); Viewport[viewport::VIEWPORT5] = glm::vec4(ViewportSize.x * 2.0f, ViewportSize.y * 1.0f, ViewportSize.x * 1.0f, ViewportSize.y * 1.0f); bool Validated = glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initTexture(); if(Validated) Validated = initSampler(); if(Validated) Validated = initVertexArray(); glBindBuffer(GL_UNIFORM_BUFFER, BufferName[buffer::TRANSFORM]); UniformPointer = (glm::mat4*)glMapBufferRange( GL_UNIFORM_BUFFER, 0, sizeof(glm::mat4), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated(true); Validated = Validated && amd::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); //move origin camera Window.TranlationCurrent.y = 5; Window.TranlationOrigin.y = Window.TranlationCurrent.y; Window.RotationCurrent.y = 30; Window.RotationOrigin.y = Window.RotationCurrent.y; Window.RotationCurrent.x = 20; Window.RotationOrigin.x = Window.RotationCurrent.x; if(Validated && amd::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initTexture(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); return Validated; }
bool begin() { int Border = 2; Viewport[0] = glm::ivec4(Border, Border, FRAMEBUFFER_SIZE - 2 * Border); Viewport[1] = glm::ivec4((Window.Size.x >> 1) + Border, 1, FRAMEBUFFER_SIZE - 2 * Border); Viewport[2] = glm::ivec4((Window.Size.x >> 1) + Border, (Window.Size.y >> 1) + Border, FRAMEBUFFER_SIZE - 2 * Border); Viewport[3] = glm::ivec4(Border, (Window.Size.y >> 1) + Border, FRAMEBUFFER_SIZE - 2 * Border); bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_ARB_viewport_array"); Validated = Validated && glf::checkExtension("GL_ARB_separate_shader_objects"); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initVertexBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initTexture(); if(Validated) Validated = initFramebuffer(); if(Validated) Validated = initSampler(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated(true); Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initTexture(); if(Validated) Validated = initFramebuffer(); glBindBuffer(GL_UNIFORM_BUFFER, BufferName[buffer::TRANSFORM]); UniformPointer = (glm::mat4*)glMapBufferRange( GL_UNIFORM_BUFFER, 0, sizeof(glm::mat4), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); return Validated; }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_EXT_direct_state_access"); Validated = Validated && glf::checkExtension("GL_ARB_texture_storage_multisample"); Validated = Validated && glf::checkExtension("GL_ARB_vertex_attrib_binding"); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initSampler(); if(Validated) Validated = initTexture(); if(Validated) Validated = initFramebuffer(); return Validated; }
bool begin() { bool Validated = glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_ARB_viewport_array"); Validated = Validated && glf::checkExtension("GL_ARB_separate_shader_objects"); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initVertexArray(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated(true); Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initTexture(); if(Validated) Validated = initProgram(); if(Validated) Validated = initVertexArray(); return Validated; }
bool begin() { bool Validated = glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); glGetIntegerv( GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &UniformBufferOffset); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); return Validated; }
bool begin() { bool Validated = amd::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated && amd::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); // Set initial rendering states glEnable(GL_DEPTH_TEST); return Validated && amd::checkError("begin"); }
bool begin() { bool Validated(true); Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_NV_shader_buffer_load"); Validated = Validated && glf::checkExtension("GL_NV_vertex_buffer_unified_memory"); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initTexture(); return Validated; }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initSeparateProgram(); if(Validated) Validated = initUnifiedProgram(); if(Validated) Validated = initVertexBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initTexture(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); glf::checkError("initProgram Apple workaround"); if(Validated) Validated = initBuffer(); if(Validated) Validated = initTexture(); if(Validated) Validated = initFramebuffer(); if(Validated) Validated = initVertexArray(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated = glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); if(Validated) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initArrayBuffer(); if(Validated) Validated = initSampler(); if(Validated) Validated = initTexture2D(); if(Validated) Validated = initFramebuffer(); if(Validated) Validated = initVertexArray(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_GTC_direct_state_access"); if(Validated) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); if(Validated) Validated = initSampler(); if(Validated) Validated = initTexture(); if(Validated) Validated = initFramebuffer(); return Validated && glf::checkError("begin"); }
bool begin() { bool Validated(true); Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); GLint MaxVaryingOutputComp(0); glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &MaxVaryingOutputComp); GLint MaxVaryingOutputVec(0); glGetIntegerv(GL_MAX_VARYING_VECTORS, &MaxVaryingOutputVec); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initTexture(); if(Validated) Validated = initProgram(); if(Validated) Validated = initBuffer(); if(Validated) Validated = initVertexArray(); return Validated; }
bool begin() { bool Validated = true; Validated = Validated && glf::checkGLVersion(SAMPLE_MAJOR_VERSION, SAMPLE_MINOR_VERSION); Validated = Validated && glf::checkExtension("GL_EXT_texture_sRGB_decode"); if(Validated && glf::checkExtension("GL_ARB_debug_output")) Validated = initDebugOutput(); if(Validated) Validated = initProgram(); if(Validated) Validated = initSampler(); if(Validated) Validated = initArrayBuffer(); if(Validated) Validated = initTexture2D(); if(Validated) Validated = initFramebuffer(); if(Validated) Validated = initVertexArray(); return Validated && glf::checkError("begin"); }
int main(int argc, char * argv[]) { #ifdef NO_NETWORK_ACCESS_MANAGER QNetworkProxyFactory::setApplicationProxyFactory(&proxies); #endif //NO_NETWORK_ACCESS_MANAGER int res=0; #ifdef HARDWARE_DEBUG_TRACE initDebugOutput(); qInstallMsgHandler(debugOutput); #endif // qDebug() << "main - before app, argc=" << argc; // for (int i = 0; i < argc; ++i) // { // qDebug() << "main - argv[" << i << "] = " << argv[i]; // } /* openurl should only work in Orbit UI application. */ #ifdef ORBIT_UI #ifdef OPENURL #ifdef NO_QSTM_GESTURE HbApplication app(AppFactoryL, argc, argv); #else BrowserApp app(AppFactoryL, argc, argv); #endif #else /* !OPENURL */ #ifdef NO_QSTM_GESTURE HbApplication app(argc, argv); #else // ORBIT_UI BrowserApp app(argc, argv); #endif #endif /* OPENURL */ #else #ifdef NO_QSTM_GESTURE QApplication app(argc, argv); #else BrowserApp app(argc, argv); #endif #endif // ORBIT_UI #ifdef QTHIGHWAY //qDebug() << "ServiceInfo:" << (XQServiceUtil::isService() ? "Service" : "Normal") << "launch"; //qDebug() << " Embedded=" << XQServiceUtil::isEmbedded() << "Interface=" << XQServiceUtil::interfaceName() << "Operation=" << XQServiceUtil::operationName(); // provide service for html mime type FileService *fileServiceProvider = new FileService(); #endif // qDebug() << "main - after app"; #ifdef Q_OS_SYMBIAN //Object cache settings. NB: these need to be tuned per device QWebSettings::globalSettings()->setObjectCacheCapacities(128*1024, 1024*1024, 1024*1024); #endif if (BEDROCK_PROVISIONING::BedrockProvisioning::createBedrockProvisioning()->value("DnsPrefetchEnabled").toBool()) { // Specifies whether QtWebkit will try to pre-fetch DNS entries to speed up browsing. // Without this technique, the DNS lookup is performed only when you click on the link, // adding a wait of 250ms (on average) before the page even starts to show up. // This only works as a global attribute. QWebSettings::globalSettings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true); } configureHtml5OfflineStorage(); QString lang = QLocale::system().name(); //install the common translator from platform QTranslator common; common.load("z:/resource/qt/translations/common_" + lang); QApplication::installTranslator(&common); //install the translator from Browser QTranslator translator; QString transFilePath = "Z:/resource/qt/translations/"; QString transFile = QLatin1String("browserloc_") + lang; translator.load(transFile, transFilePath); QApplication::installTranslator(&translator); // To make the native urlsearch bar selection visible, the following lines have to be removed // The keypad navigation still works for ginebra2 even without enabling keypad navigation /* #ifdef Q_OS_SYMBIAN QApplication::setKeypadNavigationEnabled(true); #endif */ #ifdef OPENURL // Handle QDesktopServices.openUrl (when browser wasn't already running) QString url = CBrowserMainAppSingleton::Instance().InitialUrl(); GinebraBrowser * browser = new GinebraBrowser(0, &url); // Pass the initial url so it will be loaded as soon as the browser chrome finishes // Set things up to handle QDesktopServices.openUrl calls when browser is already running CBrowserMainAppSingleton::Instance().setUrlHandler(browser); #else GinebraBrowser * browser = new GinebraBrowser(); #endif #ifdef ENABLE_PERF_TRACE #if defined(NO_NETWORK_ACCESS_MANAGER) PERF_TRACE_OUT() << "NO_NETWORK_ACCESS_MANAGER\n"; #endif #if defined(NO_RESIZE_ON_LOAD) PERF_TRACE_OUT() << "NO_RESIZE_ON_LOAD\n"; #endif #if defined(NO_QSTM_GESTURE) PERF_TRACE_OUT() << "NO_QSTM_GESTURE\n"; #endif #if defined(__gva_no_chrome__) PERF_TRACE_OUT() << "__gva_no_chrome__\n"; #endif #if defined(NO_HISTORY) PERF_TRACE_OUT() << "NO_HISTORY\n"; #endif #endif //ENABLE_PERF_TRACE browser->show(); res = app.exec(); delete browser; #ifdef QTHIGHWAY delete fileServiceProvider; #endif #ifdef ENABLE_PERF_TRACE WrtPerfTracer::tracer()->close(); #endif //ENABLE_PERF_TRACE return res; }