~azzar1/nux/please-dont-focus-me-on-mouse-down

« back to all changes in this revision

Viewing changes to Nux/WindowCompositor.cpp

  • Committer: Tarmac
  • Author(s): Jay Taoko
  • Date: 2012-01-03 04:09:51 UTC
  • mfrom: (531.1.1 nux-today)
  • Revision ID: tarmac-20120103040951-0xbi8f10w440loqz
* Removed API:
   GraphicsDisplay& GetWindow();
   GraphicsEngine& GetGraphicsEngine();
   NThread* GetThreadApplication();
   WindowThread* GetGraphicsThread();

* Modified code to to use GetWindowThread() to access its internal objects.

* Added tests:
   - WindowThread
   - StaticText
. Fixes: . Appoved by Jason Smith.

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
    // any of the BaseWindow. Try the main window layout.
236
236
    if (*area_under_mouse_pointer == NULL)
237
237
    {
238
 
      Layout* main_window_layout = GetWindowThread()->GetMainLayout();
 
238
      Layout* main_window_layout = window_thread_->GetLayout();
239
239
      if (main_window_layout)
240
240
        *area_under_mouse_pointer = static_cast<InputArea*>(main_window_layout->FindAreaUnderMouse(mouse_position, event_type));
241
241
    }
335
335
    }
336
336
    else if (event.e_event == NUX_DND_DROP)
337
337
    {
338
 
      InputArea *current_dnd_area = GetWindowCompositor().GetDnDArea();
 
338
      InputArea *current_dnd_area = GetDnDArea();
339
339
      if (current_dnd_area->GetGeometry().IsPointInside(event.e_x - event.e_x_root, event.e_y - event.e_y_root))
340
340
        current_dnd_area->HandleDndDrop(event);
341
341
    }
834
834
    // If key_focus_area is NULL, then try the main window layout.
835
835
    if (*key_focus_area == NULL)
836
836
    {
837
 
      Layout* main_window_layout = GetWindowThread()->GetMainLayout();
 
837
      Layout* main_window_layout = window_thread_->GetLayout();
838
838
      if (main_window_layout)
839
839
      {
840
840
        *key_focus_area = NUX_STATIC_CAST(InputArea*, main_window_layout->FindKeyFocusArea(event_type, key_symbol, special_keys_state));
1206
1206
  void WindowCompositor::Draw(bool SizeConfigurationEvent, bool force_draw)
1207
1207
  {
1208
1208
    inside_rendering_cycle_ = true;
1209
 
    if (!GetWindowThread()->GetWindow().isWindowMinimized())
 
1209
    if (!window_thread_->GetGraphicsDisplay().isWindowMinimized())
1210
1210
    {
1211
1211
      //int w, h;
1212
 
      GetWindowThread()->GetGraphicsEngine().GetContextSize(m_Width, m_Height);
1213
 
      GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, m_Width, m_Height);
 
1212
      window_thread_->GetGraphicsEngine().GetContextSize(m_Width, m_Height);
 
1213
      window_thread_->GetGraphicsEngine().SetViewport(0, 0, m_Width, m_Height);
1214
1214
      
1215
1215
      // Reset the Model view Matrix and the projection matrix
1216
 
      GetWindowThread()->GetGraphicsEngine().ResetProjectionMatrix();
 
1216
      window_thread_->GetGraphicsEngine().ResetProjectionMatrix();
1217
1217
      
1218
 
      GetWindowThread()->GetGraphicsEngine().ResetModelViewMatrixStack();
1219
 
      GetWindowThread()->GetGraphicsEngine().Push2DTranslationModelViewMatrix(0.375f, 0.375f, 0.0f);
 
1218
      window_thread_->GetGraphicsEngine().ResetModelViewMatrixStack();
 
1219
      window_thread_->GetGraphicsEngine().Push2DTranslationModelViewMatrix(0.375f, 0.375f, 0.0f);
1220
1220
 
1221
1221
 
1222
1222
      if (force_draw || SizeConfigurationEvent)
1223
1223
      {
1224
1224
        // We fall here after something dramatic has happen to the window such as a resizing. In this case
1225
1225
        // everything must be rendered. This is very costly and should happen rarely.
1226
 
        if (!GetWindowThread()->IsEmbeddedWindow())
 
1226
        if (!window_thread_->IsEmbeddedWindow())
1227
1227
          RenderMainWindowComposition(true);
1228
1228
 
1229
1229
        {
1239
1239
      {
1240
1240
        // A popup removed cause the whole window to be dirty(at least some part of it).
1241
1241
        // So exchange DrawList with a real Draw.
1242
 
        if (!GetWindowThread()->IsEmbeddedWindow())
 
1242
        if (!window_thread_->IsEmbeddedWindow())
1243
1243
          RenderMainWindowComposition(false);
1244
1244
 
1245
1245
        {
1253
1253
      }
1254
1254
      else
1255
1255
      {
1256
 
        if (!GetWindowThread()->IsEmbeddedWindow())
 
1256
        if (!window_thread_->IsEmbeddedWindow())
1257
1257
          RenderMainWindowComposition(false);
1258
1258
 
1259
1259
        {
1269
1269
      m_PopupRemoved = false;
1270
1270
      m_MenuRemoved = false;
1271
1271
 
1272
 
      GetWindowThread()->GetGraphicsEngine().Pop2DWindow();
 
1272
      window_thread_->GetGraphicsEngine().Pop2DWindow();
1273
1273
    }
1274
1274
    inside_rendering_cycle_ = false;
1275
1275
  }
1280
1280
 
1281
1281
    if (window.IsValid())
1282
1282
    {
1283
 
      //GetWindowThread()->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
1284
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(GetWindowThread()->GetGraphicsEngine().GetWindowWidth(),
1285
 
          GetWindowThread()->GetGraphicsEngine().GetWindowHeight());
1286
 
      GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
 
1283
      //window_thread_->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
 
1284
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_thread_->GetGraphicsEngine().GetWindowWidth(),
 
1285
          window_thread_->GetGraphicsEngine().GetWindowHeight());
 
1286
      window_thread_->GetGraphicsEngine().EmptyClippingRegion();
1287
1287
    }
1288
1288
    else
1289
1289
    {
1290
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(GetWindowThread()->GetGraphicsEngine().GetWindowWidth(),
1291
 
          GetWindowThread()->GetGraphicsEngine().GetWindowHeight());
1292
 
      GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
 
1290
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_thread_->GetGraphicsEngine().GetWindowWidth(),
 
1291
          window_thread_->GetGraphicsEngine().GetWindowHeight());
 
1292
      window_thread_->GetGraphicsEngine().EmptyClippingRegion();
1293
1293
    }
1294
1294
 
1295
1295
    std::list<MenuPage *>::reverse_iterator rev_it_menu;
1297
1297
    for (rev_it_menu = _menu_chain->rbegin(); rev_it_menu != _menu_chain->rend( ); rev_it_menu++)
1298
1298
    {
1299
1299
      SetProcessingTopView(m_MenuWindow.GetPointer());
1300
 
      (*rev_it_menu)->ProcessDraw(GetWindowThread()->GetGraphicsEngine(), force_draw);
 
1300
      (*rev_it_menu)->ProcessDraw(window_thread_->GetGraphicsEngine(), force_draw);
1301
1301
      SetProcessingTopView(NULL);
1302
1302
    }
1303
1303
 
1304
1304
//     GetGraphicsDisplay()->GetGraphicsEngine()->SetContext(0, 0,
1305
 
//                                             GetWindowThread()->GetGraphicsEngine().GetWindowWidth(),
1306
 
//                                             GetWindowThread()->GetGraphicsEngine().GetWindowHeight());
 
1305
//                                             window_thread_->GetGraphicsEngine().GetWindowWidth(),
 
1306
//                                             window_thread_->GetGraphicsEngine().GetWindowHeight());
1307
1307
  }
1308
1308
 
1309
1309
  void WindowCompositor::DrawOverlay(bool force_draw)
1310
1310
  {
1311
1311
    ObjectWeakPtr<BaseWindow> window = m_OverlayWindow;
1312
 
    int buffer_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1313
 
    int buffer_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1312
    int buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1313
    int buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1314
1314
 
1315
1315
    if (window.IsValid())
1316
1316
    {
1317
 
      //GetWindowThread()->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
1318
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
1319
 
      GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
 
1317
      //window_thread_->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
 
1318
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
1319
      window_thread_->GetGraphicsEngine().EmptyClippingRegion();
1320
1320
    }
1321
1321
    else
1322
 
      GetWindowThread()->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
 
1322
      window_thread_->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
1323
1323
 
1324
1324
    if (OverlayDrawingCommand)
1325
1325
    {
1326
1326
      SetProcessingTopView(m_OverlayWindow.GetPointer());
1327
 
      OverlayDrawingCommand->OverlayDrawing(GetWindowThread()->GetGraphicsEngine());
 
1327
      OverlayDrawingCommand->OverlayDrawing(window_thread_->GetGraphicsEngine());
1328
1328
      SetProcessingTopView(NULL);
1329
1329
    }
1330
1330
 
1334
1334
  void WindowCompositor::DrawTooltip(bool force_draw)
1335
1335
  {
1336
1336
    ObjectWeakPtr<BaseWindow> window = _tooltip_window;
1337
 
    int buffer_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1338
 
    int buffer_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1337
    int buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1338
    int buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1339
1339
 
1340
1340
    if (window.IsValid())
1341
1341
    {
1342
 
      //GetWindowThread()->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
1343
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
1344
 
      GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
 
1342
      //window_thread_->GetGraphicsEngine().SetContext(x, y, buffer_width, buffer_height);
 
1343
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
1344
      window_thread_->GetGraphicsEngine().EmptyClippingRegion();
1345
1345
    }
1346
1346
    else
1347
 
      GetWindowThread()->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
 
1347
      window_thread_->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
1348
1348
 
1349
1349
    if (m_TooltipText.Size())
1350
1350
    {
1351
1351
        //SetProcessingTopView(_tooltip_window);
1352
 
        GetPainter().PaintShape(GetWindowThread()->GetGraphicsEngine(), _tooltip_geometry, Color(0xA0000000), eSHAPE_CORNER_ROUND10, true);
1353
 
        GetPainter().PaintTextLineStatic(GetWindowThread()->GetGraphicsEngine(), GetSysBoldFont(), _tooltip_text_geometry, m_TooltipText, Color(0xFFFFFFFF));
 
1352
        GetPainter().PaintShape(window_thread_->GetGraphicsEngine(), _tooltip_geometry, Color(0xA0000000), eSHAPE_CORNER_ROUND10, true);
 
1353
        GetPainter().PaintTextLineStatic(window_thread_->GetGraphicsEngine(), GetSysBoldFont(), _tooltip_text_geometry, m_TooltipText, Color(0xFFFFFFFF));
1354
1354
        //SetProcessingTopView(NULL);
1355
1355
    }
1356
1356
 
1361
1361
  {
1362
1362
    GetPainter().EmptyBackgroundStack();
1363
1363
    SetProcessingTopView(window);
1364
 
    window->ProcessDraw(GetWindowThread()->GetGraphicsEngine(), force_draw || window->IsRedrawNeeded());
 
1364
    window->ProcessDraw(window_thread_->GetGraphicsEngine(), force_draw || window->IsRedrawNeeded());
1365
1365
    SetProcessingTopView(NULL);
1366
1366
    GetPainter().EmptyBackgroundStack();
1367
1367
  }
1374
1374
    // to the size of the display and call EmptyClippingRegion().
1375
1375
    // Then call GetScissorRect() to get the size of the global clipping area.
1376
1376
    // This is is hack until we implement SetGlobalClippingRectangle() (the opposite of SetGlobalClippingRectangle).
1377
 
    GraphicsEngine& graphics_engine = GetWindowThread()->GetGraphicsEngine();
 
1377
    GraphicsEngine& graphics_engine = window_thread_->GetGraphicsEngine();
1378
1378
    unsigned int window_width = graphics_engine.GetWindowWidth();
1379
1379
    unsigned int window_height = graphics_engine.GetWindowHeight();
1380
1380
    GetGraphicsDisplay()->GetGpuDevice()->DeactivateFrameBuffer();
1484
1484
//                    else
1485
1485
//                    {
1486
1486
//                        shadow.OffsetPosition(4, 4);
1487
 
//                        GetPainter().PaintShape(GetWindowThread()->GetGraphicsEngine(), shadow, Color(0xFF000000), eSHAPE_CORNER_ROUND10_SHADOW);
 
1487
//                        GetPainter().PaintShape(window_thread_->GetGraphicsEngine(), shadow, Color(0xFF000000), eSHAPE_CORNER_ROUND10_SHADOW);
1488
1488
//                    }
1489
1489
          }
1490
1490
 
1514
1514
  {
1515
1515
    int buffer_width, buffer_height;
1516
1516
 
1517
 
    buffer_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1518
 
    buffer_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1517
    buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1518
    buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1519
1519
 
1520
1520
    if ((!m_MainColorRT.IsValid()) || (!m_MainDepthRT.IsValid()) || (m_MainColorRT->GetWidth() != buffer_width) || (m_MainColorRT->GetHeight() != buffer_height))
1521
1521
    {
1528
1528
    m_FrameBufferObject->SetDepthSurface(m_MainDepthRT->GetSurfaceLevel(0));
1529
1529
    m_FrameBufferObject->Activate();
1530
1530
 
1531
 
    GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
1532
 
    GetWindowThread()->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
1533
 
    GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
1534
 
    GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
1531
    window_thread_->GetGraphicsEngine().EmptyClippingRegion();
 
1532
    window_thread_->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, buffer_width, buffer_height);
 
1533
    window_thread_->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
 
1534
    window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
1535
1535
    {
1536
1536
      CHECKGL(glClear(/*GL_COLOR_BUFFER_BIT |*/ GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT));
1537
1537
      //Begin 2D Drawing
1538
1538
      {
1539
1539
        if (force_draw)
1540
1540
        {
1541
 
          GetPainter().PushDrawLayer(GetWindowThread()->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background);
1542
 
          //GetPainter().PushBackground(GetWindowThread()->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background, true);
1543
 
 
1544
 
          GetWindowThread()->ProcessDraw(GetWindowThread()->GetGraphicsEngine(), true);
1545
 
 
1546
 
          nuxAssert(GetWindowThread()->GetGraphicsEngine().GetNumberOfClippingRegions() == 0);
 
1541
          GetPainter().PushDrawLayer(window_thread_->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background);
 
1542
          //GetPainter().PushBackground(window_thread_->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background, true);
 
1543
 
 
1544
          window_thread_->ProcessDraw(window_thread_->GetGraphicsEngine(), true);
 
1545
 
 
1546
          nuxAssert(window_thread_->GetGraphicsEngine().GetNumberOfClippingRegions() == 0);
1547
1547
          GetPainter().PopBackground();
1548
1548
          GetPainter().EmptyBackgroundStack();
1549
1549
        }
1550
1550
        else
1551
1551
        {
1552
 
          GetPainter().PushLayer(GetWindowThread()->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background);
1553
 
          //GetPainter().PushBackground(GetWindowThread()->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background, false);
1554
 
 
1555
 
          GetWindowThread()->ProcessDraw(GetWindowThread()->GetGraphicsEngine(), false);
1556
 
 
1557
 
          nuxAssert(GetWindowThread()->GetGraphicsEngine().GetNumberOfClippingRegions() == 0);
 
1552
          GetPainter().PushLayer(window_thread_->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background);
 
1553
          //GetPainter().PushBackground(window_thread_->GetGraphicsEngine(), Geometry(0, 0, buffer_width, buffer_height), m_Background, false);
 
1554
 
 
1555
          window_thread_->ProcessDraw(window_thread_->GetGraphicsEngine(), false);
 
1556
 
 
1557
          nuxAssert(window_thread_->GetGraphicsEngine().GetNumberOfClippingRegions() == 0);
1558
1558
          GetPainter().PopBackground();
1559
1559
          GetPainter().EmptyBackgroundStack();
1560
1560
        }
1569
1569
      //GetGraphicsDisplay()->GetGraphicsEngine()->QRP_Color(geo.x, geo.y, geo.width, geo.height, color::Blue);
1570
1570
    }
1571
1571
 
1572
 
    GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
1572
    window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
1573
1573
    m_FrameBufferObject->Deactivate();
1574
1574
 
1575
1575
    unsigned int window_width, window_height;
1576
 
    window_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1577
 
    window_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
1578
 
    GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
1579
 
    GetWindowThread()->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, window_width, window_height);
1580
 
    GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, window_width, window_height);
1581
 
    GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_width, window_height);
 
1576
    window_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1577
    window_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
 
1578
    window_thread_->GetGraphicsEngine().EmptyClippingRegion();
 
1579
    window_thread_->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, window_width, window_height);
 
1580
    window_thread_->GetGraphicsEngine().SetViewport(0, 0, window_width, window_height);
 
1581
    window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_width, window_height);
1582
1582
 
1583
1583
    PresentBufferToScreen(m_MainColorRT, 0, 0, false);
1584
1584
 
1592
1592
      return;
1593
1593
 
1594
1594
    int window_width, window_height;
1595
 
    window_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1596
 
    window_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1595
    window_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1596
    window_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1597
1597
 
1598
1598
 
1599
1599
    if (RenderToMainTexture && (HWTexture != m_MainColorRT))
1610
1610
      GetGraphicsDisplay()->GetGpuDevice()->DeactivateFrameBuffer();
1611
1611
    }
1612
1612
 
1613
 
    GetWindowThread()->GetGraphicsEngine().EmptyClippingRegion();
1614
 
    GetWindowThread()->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, window_width, window_height);
1615
 
    GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, window_width, window_height);
1616
 
    GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_width, window_height);
 
1613
    window_thread_->GetGraphicsEngine().EmptyClippingRegion();
 
1614
    window_thread_->GetGraphicsEngine().SetOpenGLClippingRectangle(0, 0, window_width, window_height);
 
1615
    window_thread_->GetGraphicsEngine().SetViewport(0, 0, window_width, window_height);
 
1616
    window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(window_width, window_height);
1617
1617
 
1618
1618
    // Render the MAINFBO
1619
1619
    {
1626
1626
 
1627
1627
      if (premultiply)
1628
1628
      {
1629
 
        GetWindowThread()->GetGraphicsEngine().GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
1629
        window_thread_->GetGraphicsEngine().GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1630
1630
        GetGraphicsDisplay()->GetGraphicsEngine()->QRP_1Tex(x, y, src_width, src_height, HWTexture, texxform0, Color(opacity, opacity, opacity, opacity));
1631
1631
      }
1632
1632
      else
1633
1633
      {
1634
 
        GetWindowThread()->GetGraphicsEngine().GetRenderStates().SetBlend(false);
 
1634
        window_thread_->GetGraphicsEngine().GetRenderStates().SetBlend(false);
1635
1635
        GetGraphicsDisplay()->GetGraphicsEngine()->QRP_1Tex(x, y, src_width, src_height, HWTexture, texxform0, Color(1.0f, 1.0f, 1.0f, opacity));
1636
1636
      }
1637
 
      GetWindowThread()->GetGraphicsEngine().GetRenderStates().SetBlend(false);
 
1637
      window_thread_->GetGraphicsEngine().GetRenderStates().SetBlend(false);
1638
1638
    }
1639
1639
  }
1640
1640
 
1927
1927
 
1928
1928
  void WindowCompositor::FormatRenderTargets(int width, int height)
1929
1929
  {
1930
 
    int buffer_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1931
 
    int buffer_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1930
    int buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1931
    int buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1932
1932
 
1933
1933
    nuxAssert(buffer_width >= 1);
1934
1934
    nuxAssert(buffer_height >= 1);
1985
1985
      m_FrameBufferObject->SetDepthSurface(rt.depth_rt->GetSurfaceLevel(0));
1986
1986
      m_FrameBufferObject->Activate();
1987
1987
 
1988
 
      GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
1989
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
1990
 
      GetWindowThread()->GetGraphicsEngine().ApplyClippingRectangle();
1991
 
      //GetWindowThread()->GetGraphicsEngine().ApplyModelViewMatrix(); ???
 
1988
      window_thread_->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
 
1989
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
1990
      window_thread_->GetGraphicsEngine().ApplyClippingRectangle();
 
1991
      //window_thread_->GetGraphicsEngine().ApplyModelViewMatrix(); ???
1992
1992
    }
1993
1993
    else
1994
1994
    {
1995
 
      int buffer_width = GetWindowThread()->GetGraphicsEngine().GetWindowWidth();
1996
 
      int buffer_height = GetWindowThread()->GetGraphicsEngine().GetWindowHeight();
 
1995
      int buffer_width = window_thread_->GetGraphicsEngine().GetWindowWidth();
 
1996
      int buffer_height = window_thread_->GetGraphicsEngine().GetWindowHeight();
1997
1997
 
1998
1998
      nuxAssert(buffer_width >= 1);
1999
1999
      nuxAssert(buffer_height >= 1);
2003
2003
      m_FrameBufferObject->SetDepthSurface(m_MainDepthRT->GetSurfaceLevel(0));
2004
2004
      m_FrameBufferObject->Activate();
2005
2005
 
2006
 
      GetWindowThread()->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
2007
 
      GetWindowThread()->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
2008
 
      GetWindowThread()->GetGraphicsEngine().ApplyClippingRectangle();
2009
 
      //GetWindowThread()->GetGraphicsEngine().ApplyModelViewMatrix(); ???
 
2006
      window_thread_->GetGraphicsEngine().SetViewport(0, 0, buffer_width, buffer_height);
 
2007
      window_thread_->GetGraphicsEngine().SetOrthographicProjectionMatrix(buffer_width, buffer_height);
 
2008
      window_thread_->GetGraphicsEngine().ApplyClippingRectangle();
 
2009
      //window_thread_->GetGraphicsEngine().ApplyModelViewMatrix(); ???
2010
2010
    }
2011
2011
  }
2012
2012
 
2076
2076
      return result;
2077
2077
    }
2078
2078
    
2079
 
    if (GetWindow().PointerGrabData() != this)
2080
 
      result = GetWindow().GrabPointer(NULL, this, true);
 
2079
    if (window_thread_->GetGraphicsDisplay().PointerGrabData() != this)
 
2080
      result = window_thread_->GetGraphicsDisplay().GrabPointer(NULL, this, true);
2081
2081
 
2082
2082
    if (result)
2083
2083
      pointer_grab_stack_.push_front(area);
2103
2103
    pointer_grab_stack_.erase(it);
2104
2104
    
2105
2105
    if (pointer_grab_stack_.empty())
2106
 
      GetWindow().UngrabPointer(this);
 
2106
      window_thread_->GetGraphicsDisplay().UngrabPointer(this);
2107
2107
    
2108
2108
    // reset the mouse pointers areas.
2109
2109
    ResetMousePointerAreas();
2143
2143
      return result;
2144
2144
    }
2145
2145
 
2146
 
    if (GetWindow().KeyboardGrabData() != this)
 
2146
    if (window_thread_->GetGraphicsDisplay().KeyboardGrabData() != this)
2147
2147
    {
2148
 
      result = GetWindow().GrabKeyboard(NULL, this, true);
 
2148
      result = window_thread_->GetGraphicsDisplay().GrabKeyboard(NULL, this, true);
2149
2149
    }
2150
2150
    
2151
2151
    if (result)
2214
2214
 
2215
2215
    if (keyboard_grab_stack_.empty())
2216
2216
    {
2217
 
      GetWindow().UngrabKeyboard(this);
 
2217
      window_thread_->GetGraphicsDisplay().UngrabKeyboard(this);
2218
2218
    }
2219
2219
 
2220
2220
    // Must be called only after the area has been added to the front of keyboard_grab_stack_.