void GLContext::realize(int width, int height) { width_ = width; height_ = height; glViewport(0, 0, width, height); glDepthRange(0.0f, 1.0f); initDefaultMap(defaultAmbientMap, 0x808080); initDefaultMap(defaultDiffuseMap, 0x808080); initDefaultMap(defaultSpecularMap, 0x808080); initDefaultMap(defaultEmissiveMap, 0x000000); initDefaultMap(defaultOpacityMap, 0xffffff); initDefaultMap(defaultCustomMap, 0xffffff); compileShaders(); }
void PianoKeybd::initialize() { setAttribute(Qt::WA_AcceptTouchEvents); setAttribute(Qt::WA_InputMethodEnabled, false); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setCacheMode(CacheBackground); setViewportUpdateMode(MinimalViewportUpdate); setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::SmoothPixmapTransform); setOptimizationFlag(DontClipPainter, true); setOptimizationFlag(DontSavePainterState, true); setOptimizationFlag(DontAdjustForAntialiasing, true); setBackgroundBrush(QApplication::palette().background()); initDefaultMap(); #if defined(RAWKBD_SUPPORT) RawKeybdApp* rapp = dynamic_cast<RawKeybdApp*>(qApp); if (rapp != NULL) { rapp->setRawKbdHandler(this); } #endif }