~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/gameengine/GamePlayer/ghost/GPG_Application.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
                }
261
261
 
262
262
                SetParent(ghost_hwnd, parentWindow);
263
 
                LONG style = GetWindowLong(ghost_hwnd, GWL_STYLE);
264
 
                LONG exstyle = GetWindowLong(ghost_hwnd, GWL_EXSTYLE);
 
263
                LONG_PTR style = GetWindowLongPtr(ghost_hwnd, GWL_STYLE);
 
264
                LONG_PTR exstyle = GetWindowLongPtr(ghost_hwnd, GWL_EXSTYLE);
265
265
 
266
266
                RECT adjrc = { 0, 0, windowWidth, windowHeight };
267
267
                AdjustWindowRectEx(&adjrc, style, FALSE, exstyle);
268
268
 
269
269
                style = (style & (~(WS_POPUP|WS_OVERLAPPEDWINDOW|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_TILEDWINDOW ))) | WS_CHILD;
270
 
                SetWindowLong(ghost_hwnd, GWL_STYLE, style);
 
270
                SetWindowLongPtr(ghost_hwnd, GWL_STYLE, style);
271
271
                SetWindowPos(ghost_hwnd, NULL, adjrc.left, adjrc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
272
272
 
273
273
                /* Check the size of the client rectangle of the window and resize the window
308
308
 
309
309
#endif
310
310
 
311
 
bool GPG_Application::startWindow(STR_String& title,
312
 
        int windowLeft,
313
 
        int windowTop,
314
 
        int windowWidth,
315
 
        int windowHeight,
316
 
        const bool stereoVisual,
317
 
        const int stereoMode,
318
 
        const GHOST_TUns16 samples)
 
311
bool GPG_Application::startWindow(
 
312
        STR_String& title,
 
313
        int windowLeft,
 
314
        int windowTop,
 
315
        int windowWidth,
 
316
        int windowHeight,
 
317
        const bool stereoVisual,
 
318
        const int stereoMode,
 
319
        const GHOST_TUns16 samples)
319
320
{
320
321
        bool success;
321
322
        // Create the main window
322
323
        //STR_String title ("Blender Player - GHOST");
323
324
        m_mainWindow = fSystem->createWindow(title, windowLeft, windowTop, windowWidth, windowHeight, GHOST_kWindowStateNormal,
324
 
                GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples);
 
325
                                             GHOST_kDrawingContextTypeOpenGL, stereoVisual, false, samples);
325
326
        if (!m_mainWindow) {
326
327
                printf("error: could not create main window\n");
327
328
                exit(-1);
340
341
        return success;
341
342
}
342
343
 
343
 
bool GPG_Application::startEmbeddedWindow(STR_String& title,
344
 
        const GHOST_TEmbedderWindowID parentWindow, 
345
 
        const bool stereoVisual, 
346
 
        const int stereoMode,
347
 
        const GHOST_TUns16 samples) {
 
344
bool GPG_Application::startEmbeddedWindow(
 
345
        STR_String& title,
 
346
        const GHOST_TEmbedderWindowID parentWindow,
 
347
        const bool stereoVisual,
 
348
        const int stereoMode,
 
349
        const GHOST_TUns16 samples)
 
350
{
348
351
        GHOST_TWindowState state = GHOST_kWindowStateNormal;
349
352
        if (parentWindow != 0)
350
353
                state = GHOST_kWindowStateEmbedded;
351
354
        m_mainWindow = fSystem->createWindow(title, 0, 0, 0, 0, state,
352
 
                GHOST_kDrawingContextTypeOpenGL, stereoVisual, samples, parentWindow);
 
355
                                             GHOST_kDrawingContextTypeOpenGL, stereoVisual, false, samples, parentWindow);
353
356
 
354
357
        if (!m_mainWindow) {
355
358
                printf("error: could not create main window\n");
366
369
 
367
370
 
368
371
bool GPG_Application::startFullScreen(
369
 
                int width,
370
 
                int height,
371
 
                int bpp,int frequency,
372
 
                const bool stereoVisual,
373
 
                const int stereoMode,
374
 
                const GHOST_TUns16 samples,
375
 
                bool useDesktop)
 
372
        int width,
 
373
        int height,
 
374
        int bpp,int frequency,
 
375
        const bool stereoVisual,
 
376
        const int stereoMode,
 
377
        const GHOST_TUns16 samples,
 
378
        bool useDesktop)
376
379
{
377
380
        bool success;
378
381
        GHOST_TUns32 sysWidth=0, sysHeight=0;
386
389
 
387
390
        fSystem->beginFullScreen(setting, &m_mainWindow, stereoVisual, samples);
388
391
        m_mainWindow->setCursorVisibility(false);
 
392
        /* note that X11 ignores this (it uses a window internally for fullscreen) */
389
393
        m_mainWindow->setState(GHOST_kWindowStateFullScreen);
390
394
 
391
395
        success = initEngine(m_mainWindow, stereoMode);
499
503
                                GHOST_Rect bnds;
500
504
                                window->getClientBounds(bnds);
501
505
                                m_canvas->Resize(bnds.getWidth(), bnds.getHeight());
 
506
                                m_ketsjiengine->Resize();
502
507
                        }
503
508
                        }
504
509
                        break;
549
554
                GameData *gm= &m_startScene->gm;
550
555
                bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0);
551
556
                bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0);
552
 
                bool fixedFr = (gm->flag & GAME_ENABLE_ALL_FRAMES);
553
557
 
554
558
                bool showPhysics = (gm->flag & GAME_SHOW_PHYSICS);
555
559
                SYS_WriteCommandLineInt(syshandle, "show_physics", showPhysics);
556
560
 
557
 
                bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixedtime", fixedFr) != 0);
 
561
                bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixedtime", (gm->flag & GAME_ENABLE_ALL_FRAMES)) != 0);
558
562
                bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0);
559
563
                bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", gm->flag & GAME_DISPLAY_LISTS) != 0);
560
564
                bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 1) != 0);
627
631
                m_ketsjiengine->SetRenderTools(m_rendertools);
628
632
                m_ketsjiengine->SetRasterizer(m_rasterizer);
629
633
 
630
 
                m_ketsjiengine->SetTimingDisplay(frameRate, false, false);
631
 
 
632
634
                KX_KetsjiEngine::SetExitKey(ConvertKeyCode(gm->exitkey));
633
635
#ifdef WITH_PYTHON
634
636
                CValue::SetDeprecationWarnings(nodepwarnings);