Results 1 to 6 of 6

Thread: Error on Fullscreen switch

  1. #1
    Lesser Knight
    Join Date
    May 2007
    Posts
    46

    Default Error on Fullscreen switch

    When I try to swap to fullscreen mode I get the following error on some systems (Intel Video)

    CL_Displaywindow_32 Damn Murphy must hate you Coinitizilied Failed

    Any clues?

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    It's a problem with Direct Input

    Ensure directx 8 or above is installed. (Start menu / Run / dxdiag.exe)

    If that is okay,

    In Sources/Display/WIN32/display_window_win32.cpp

    What happens when you comment out the line #define "BROKEN_DINPUT" ?

  3. #3
    Lesser Knight
    Join Date
    May 2007
    Posts
    46

    Default

    Thanks for the reply, that was the issue.

    BUT... (Theres always a "but")

    Now all Intel graphics systems do not work in full screen mode. Just a crash, no message.

    In the past, I have had issues with Intel that moving the display mode to 16 bit made it work, but setting it to 16 bit doesn't seem to have any effect.
    Code:
    		CL_DisplayWindowDescription desc;
    		desc.set_bpp(16);
    		desc.set_size(CL_Size(800,600));
    		desc.set_fullscreen(true);
    		desc.set_title("Game");
    		CL_DisplayWindow myWin(desc);
    That seems to have no effect for 16 or 32 on my other systems, visually it looks to still be 32 bit.
    Last edited by madmark; 11-27-2007 at 11:54 PM. Reason: Early submit

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Well well, this is yet another example that should teach me to stop making silly error messages for things I find totally unlikely to happen!

    The code causing this error:

    Code:
    HRESULT result = CoInitialize(0);
    if (FAILED(result))
      throw CL_Exception(...)
    Looking at the documentation for CoInitialize, the most likely cause for this error is that someone already initialized COM with a different concurrency model:

    Once the concurrency model for a thread is set, it cannot be changed. A call to CoInitialize on an apartment that was previously initialized as multithreaded will fail and return RPC_E_CHANGED_MODE.

    Typically, the COM library is initialized on a thread only once. Subsequent calls to CoInitialize or CoInitializeEx on the same thread will succeed, as long as they do not attempt to change the concurrency model, but will return S_FALSE. To close the COM library gracefully, each successful call to CoInitialize or CoInitializeEx, including those that return S_FALSE, must be balanced by a corresponding call to CoUninitialize. However, the first thread in the application that calls CoInitialize(0) or CoInitializeEx(COINIT_APARTMENTTHREADED) must be the last thread to call CoUninitialize(). If the call sequence is not in this order, then subsequent calls to CoInitialize on the STA will fail and the application will not work.

    Because there is no way to control the order in which in-process servers are loaded or unloaded, do not call CoInitialize, CoInitializeEx, or CoUninitialize from the DllMain function.
    The concurrency model used by CoInitialize is single-thread apartment. If you have some other library (or DLL loaded into your process) that sets the model to something else, then it will fail at this spot. You could try replace the line with a call to CoInitializeEx and some different constants - i.e. COINIT_MULTITHREADED. Technically ClanLib's COM usage doesn't really care which concurrency model is used, but I have no idea what DirectInput internally requires.

    If you figure out which constants do work out for you, let me know. Also, it would be nice to get a list of DLLs loaded into your process on the machine - you can see them via Process Explorer.

  5. #5
    Lesser Knight
    Join Date
    May 2007
    Posts
    46

    Default

    Thanks for the reply, I will look further into it.

    Any opinion on the (unrelated) Intel chip fullscreen issue? This is holding up gold master now

  6. #6
    Lesser Knight
    Join Date
    May 2007
    Posts
    46

    Default

    A thought...

    Wouldn't is be better to check for RPC_E_CHANGED_MODE before throwing the exception and not throwing it?

Similar Threads

  1. ClanLib sound switch from dsound to openal?
    By imnotbncre8ive in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 11-03-2007, 06:02 PM
  2. Fix for Fullscreen mode
    By glorified_ameba in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 07-27-2007, 04:22 PM
  3. make fullscreen 1280x1024
    By gmatt in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-25-2007, 08:34 AM
  4. I'm getting strange error
    By Homer89 in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 05-28-2007, 07:11 PM
  5. Novashell fullscreen overrides command-tab app swithing in osx
    By whisperstorm in forum Novashell Game Creation System
    Replies: 2
    Last Post: 01-13-2007, 06:32 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •