Results 1 to 10 of 10

Thread: ClanLib 0.8.1 desktop depth check method?

  1. #1
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default ClanLib 0.8.1 desktop depth check method?

    I have a display problem with ClanLib 0.8.1. I use 24bit with 8bit alpha channel images and when the game is run in windowed mode and the desktop is a 16bit display, it does not look properly. I wanted to put a check in the code and if its a 16bit windowed mode then the warning is displayed and the game quits. Unfortunately, I've tried everything and it just does not work. Can you help? The fullscreen mode is working because it is always forced to 32bit, but the windowed mode retains the depth of the desktop. Is there a way to check if the desktop is 16bit?

  2. #2
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    I've also noticed that when the in windowed mode and desktop is 16bit, the following line is not having any effect:

    CL_PixelBuffer pixelbuffer = CL_PixelBuffer(CLevel::Width, _tileHeight, CLevel::Width*4, CL_PixelFormat::rgba8888);

    and all the surfaces created with the above pixelbuffer when drawn are not visible, while in 32bit desktop everything works properly.

    Also, even if in 16bit desktop windowed mode, the following lines are always returning 32 as the value of the depth:

    CL_PixelBuffer pb = window.get_buffer(0); // either 0 or 1, its always 32 for depth
    CL_PixelFormat pf = pb.get_format();
    cout << "depth: " << pf.get_depth() << endl;

    Is this a bug or am I doing it the wrong way?

  3. #3
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    I think I've found what the problem is. It appears that everything is working and it does not matter if its 32bit or 16bit, all the graphics are displayed. The only graphics that are not displayed under 16bit windowed mode are the graphics that are generated using the following lines of code:

    canvas = new CL_Canvas( *_levelMap[startMapPart] );
    tmp->draw( pos.x, startYexplosion, canvas->get_gc() );

    All the surfaces that are generated using the above lines (when the surface is generated from other surfaces) are displayed only when in 32bit mode and never under 16bit mode. It appears that canvas->get_gc() is not functioning under 16bit mode at all.

  4. #4
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    I feel like talking to myself. Am I on ignore list or something? I do tend to react harshly, that's because ClanLib is giving me hard time and I'm frustrated, so I'm sorry if that's the case.

    canvas->get_gc() is returning always memory address beginning with 2 in 16bit mode and beginning with 3 in 32bit mode. However, drawing one surface onto another is not happening in 16bit mode. I assume that both surfaces must be 16bit colors for this to happen? Can you help, I'm not that far from finishing the game, just another 4-5 months.

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

    Default

    I can't personally help, as I do not understand the internals of ClanLib 0.8 (1.0).

  6. #6
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    We're not ignoring you, its just that all development focus is on 2.0, and noone really knows (or cares) about the internals of 0.8/1.0 anymore.

  7. #7
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    Oh ...

  8. #8
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    I switched to SDL instead of OpenGL and while it returns the correct depth of 16, because it is 16bit display, it throws an exception:

    "Congratulations! You just got assigned the task of implementing system fonts for clanSDL :-)"

    What is that?

    Isn't there a way for OpenGL version to return the correct depth?

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

    Default

    Quote Originally Posted by alexv1 View Post
    I switched to SDL instead of OpenGL and while it returns the correct depth of 16, because it is 16bit display, it throws an exception:

    "Congratulations! You just got assigned the task of implementing system fonts for clanSDL :-)"

    What is that?

    Isn't there a way for OpenGL version to return the correct depth?
    The "Congratulations!" message is shown because nobody has coded the function.

    However, since you are using OpenGL, the screen depth should not matter. I would have thought that OpenGL does all the conversion for you.

    Have you checked the Basic2D example works with a 16 bit depth? (And check that you have the latest graphic card drivers)

  10. #10
    Knight
    Join Date
    Feb 2009
    Location
    I looked through my window, there are no signs ... but, its definitely planet Earth.
    Posts
    88

    Default

    Ok, I'm attaching the screen shots, one in 32bit and the other in 16bit desktop mode. The difference is that in 16bit desktop mode the debris marked on screen shot is not drawn on the level surface at all, while in 32bit desktop display mode it is. My idea is for this to be a total massacre and there will be a lot of debris, because there is no reason to store position of the debris, the best approach is to draw the debris onto the level surface and forget about it. Please see the screenshots.

    I know it looks like a crap on the middle of the screen, but its randomly generated from other smaller surfaces, so its different each time explosion happens .. its not finished yet. I don't think this has anything to do with bad driver, I'm playing games using OpenGL for many years and they all work fine, the problem is drawing surface onto another surface with ClanLib using OpenGL for some reason.
    Attached Files Attached Files

Similar Threads

  1. depth colisions
    By attle in forum Novashell Game Creation System
    Replies: 0
    Last Post: 10-22-2008, 05:09 AM
  2. Depth
    By attle in forum Novashell Game Creation System
    Replies: 2
    Last Post: 09-16-2008, 06:48 AM
  3. How to use gui without .run() blocking method ?
    By hubadu in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 05-16-2007, 07:48 PM
  4. Please check out my server
    By in forum Funeral Quest
    Replies: 5
    Last Post: 09-08-2003, 11:41 PM
  5. seth check  your emails
    By sim in forum RTsoft Tavern
    Replies: 0
    Last Post: 07-25-2003, 09:51 PM

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
  •