Results 1 to 6 of 6

Thread: Mac vs. Windows bits

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

    Default Mac vs. Windows bits

    My port from Windows to Mac is going very very well, thanks mainly to ClanLib.

    But... (as always, there is a "but")

    On the Mac, I see lines a garbage pixels on top and to the left of surfaces drawn to the screen. It seems worse if the surface is drawn rotated (on 90 degree marks).

    Here are some screenshots:




  2. #2
    Lesser Knight
    Join Date
    Sep 2006
    Posts
    41

    Default

    Set the texture mode to clamp rather than repeat, and that should solve it. Something like

    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );

    should do the trick. Most cards normally wrap the textures, which is what you're seeing here (those lines are really from the opposite side of the texture). Clamping it instead will not allow the texture to wrap around like that.

    Just be sure to set it back if you need to tile textures later

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

    Default

    Thanks for the answer!

    Where do you think is a good place for this?

    Edit: I put it at the start of my render function (using clTexParameteri) and it made no difference. This could be because I don't understand the internals of the ClanLib OpenGL stuff or it is something else.
    Last edited by madmark; 01-07-2008 at 09:47 PM. Reason: Added Information

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

    Default

    For completeness...

    I tried the above and it didn't fix the problem, but I was reminded of a similar issue I had with a DirectX project. The fix for that was to move the FP coords 0.5f toward the center of the 2D image.

    That fix worked great.

  5. #5
    Lesser Knight
    Join Date
    Sep 2006
    Posts
    41

    Default

    Ah, then the problem is the location of the center of the pixel. That is, do you define the location of the pixel coordinate being the lower left corner of the pixel, or the center of the pixel?

    Older versions of DirectX allowed the adjustment of this, as different games relied on different behavior. Unfortunately, that functionality is no longer present (or, at least, no longer present in the NVidia drivers), meaning some old games are unable to render correctly (this is the main reason I am no longer able to play X-Wing Alliance ).

  6. #6
    Squire
    Join Date
    Oct 2007
    Posts
    13

    Default

    Or as an alternative, allocate a blank pixel between each tile.
    These artifacts are also obvious if you try to scale sprites too.

Similar Threads

  1. Can't find windows.h - Compiling ClanLib
    By Katzewurzt in forum Official ClanLib SDK Forums
    Replies: 18
    Last Post: 11-04-2007, 06:49 AM
  2. Anybody have DirectX sdk files necessary for compiling on windows?
    By imnotbncre8ive in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 10-31-2007, 02:38 PM
  3. Latest windows build corrupted?
    By whisperstorm in forum Novashell Game Creation System
    Replies: 1
    Last Post: 03-03-2007, 12:22 PM
  4. Animated Windows and Dialogs
    By AllenJB in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 09-20-2006, 04:28 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
  •