Giter VIP home page Giter VIP logo

Comments (3)

illume avatar illume commented on May 22, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Seems fixed in the repository.

from pygame.

illume avatar illume commented on May 22, 2024

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Here is an easier to run example, that also shows the problem is to do with the screen surface and the draw routine.

import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode( (200, 200), 0, 32 )
surf = screen
print "screen info", surf.get_masks(), surf.get_shifts(), surf.get_pitch(), surf.get_losses()
surf = pygame.Surface( (200,200), 0, 32)
print "surface info", surf.get_masks(), surf.get_shifts(), surf.get_pitch(), surf.get_losses()

surf.fill((0,0,0,255))
pygame.draw.line( surf, (255, 255, 255), (0,0), (100, 100) )
pygame.draw.aaline( surf, (255, 255, 255), (0,100), (100, 200) )
screen.blit(surf, (0,0))

going = True
while going:
    events = pygame.event.get()
    if QUIT in [e.type for e in events]:
        going = False
    pygame.display.update()

On OSX Lion 64bit python it prints:

screen info (65280, 16711680, 4278190080, 0) (8, 16, 24, 0) 800 (0, 0, 0, 8)
surface info (16711680, 65280, 255, 0) (16, 8, 0, 0) 800 (0, 0, 0, 8)

So we can see that the screen surface, and a normal software surface is laid out differently. So there must be an issue with the draw.aaline method and this type of memory layout.

The example above shows a work around, of blitting to a normal surface and then blitting that surface to the screen. This works as expected and gives a white line, not a yellow one.

from pygame.

carlosgmartin avatar carlosgmartin commented on May 22, 2024

I'm getting the same problem with version 1.9.3.

from pygame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.