Results 1 to 5 of 5

Thread: CL_PixelBuffer::get_pixel() weird results...

  1. #1
    Squire Otto (Strange) Halmén's Avatar
    Join Date
    Sep 2006
    Location
    A city called Loviisa, in southern Finland, Europe.
    Posts
    20

    Post CL_PixelBuffer::get_pixel() weird results...

    I have attached a screenshot of a strange result when using the function CL_PixelBuffer::get_pixel(). To the right there is a CL_Surface object drawn with CL_Surface::draw(), in the middle you can see a bit of the blue background, and to the left there's the pixelbuffer drawn with this code:
    Code:
    for (int i = 0; i < buffer.get_height(); i++)
    {
    	for (int j = 0; j < buffer.get_width(); j++)
    	{
    		gc->draw_pixel(j, i, buffer.get_pixel(j, i));
    	}
    }
    ...where gc is a pointer to the graphic context and buffer is a CL_PixelBuffer object obtained from the surface by CL_Surface::get_pixeldata(). I've called CL_PixelBuffer::lock() before getting the pixels, as told in the reference manual. I've even tried calling unlock(), and calling neither lock() nor unlock(), but the results are the same: CL_Surface::draw() shows the original PNG image as it appeared when I saved it, but CL_PixelBuffer::get_pixel() gives strange results. Is this a bug or have I done something wrong?

    BTW, the image was edited from Super Mario 64 textures.
    Attached Images Attached Images  
    In Finnish, "Strange" is spelled "Outo" which is very similar to my real first name, but that's not the main reason why my friends chose to call me that...

    No homepage yet, but when my raycaster becomes good enough to be released, I'll make one.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Hmm, interesting. Sounds like a bug - are you using the latest SVN 0.8?

    Could you possibly attach a sample app source zip showing the problem? (could use the Basic2D example as the base..)
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Squire Otto (Strange) Halmén's Avatar
    Join Date
    Sep 2006
    Location
    A city called Loviisa, in southern Finland, Europe.
    Posts
    20

    Default Re:

    I am using the latest stable version of ClanLib 0.8 (no SVN, downloaded it from ClanLib's home page). Attached is a zip with the source file (containing the code that I already quoted) and the PNG texture file.
    Attached Files Attached Files
    In Finnish, "Strange" is spelled "Outo" which is very similar to my real first name, but that's not the main reason why my friends chose to call me that...

    No homepage yet, but when my raycaster becomes good enough to be released, I'll make one.

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Cool

    I ran it and it works correctly here. (winxp, radeon 800 XL) (both images look identical, not washed out or weird alpha values)

    If possible, please try it with the SVN 0.8, when I added the BMP loader I did fix some long standing pixel conversion issues...

    If that doesn't fix it, it may be a specific video card issue.

    PS: A file called ".bricks.png" was included in your zip in the __MACOS dir, I tried it too, but the PNG loader asserted it was a bad png.
    Seth A. Robinson
    Robinson Technologies

  5. #5
    Squire Otto (Strange) Halmén's Avatar
    Join Date
    Sep 2006
    Location
    A city called Loviisa, in southern Finland, Europe.
    Posts
    20

    Default

    Trying to download the latest SVN 0.8 gives me an error:
    Safari ei voi avata kohdetta ”svn://esoteric.clanlib.org/ClanLib/Development/ClanLib-0.8”, koska Mac OS X ei tunnista internet-osoitteita, jotka alkavat ”svn:”.
    That is:
    Safari is unable to open the location ”svn://esoteric.clanlib.org/ClanLib/Development/ClanLib-0.8”, because MacOS X is unable to identify paths beginning with ”svn:”.
    In Finnish, "Strange" is spelled "Outo" which is very similar to my real first name, but that's not the main reason why my friends chose to call me that...

    No homepage yet, but when my raycaster becomes good enough to be released, I'll make one.

Similar Threads

  1. Weird build problem
    By void_kill in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 11-10-2006, 06:18 PM
  2. Somthin Weird
    By AntiLoveShadow in forum Dink Smallwood HD
    Replies: 2
    Last Post: 11-26-2004, 12:52 PM
  3. Try my weird little game
    By Seth in forum RTsoft Tavern
    Replies: 10
    Last Post: 03-29-2003, 08:34 PM
  4. Weird Idea
    By redink1 in forum Funeral Quest
    Replies: 1
    Last Post: 12-07-2002, 11:32 PM
  5. Weird Redraw Bug
    By redink1 in forum Other RTsoft Games
    Replies: 1
    Last Post: 10-14-2002, 10: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
  •