[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Hardware Surface with Font.Blit
hi,
you need to render to a texture, and then display that.
The blit, and draw functions do not work in opengl mode.
Cheers.
On Thu, 16 Jun 2005 11:27:59, python@xxxxxxxxxxxx <python@xxxxxxxxxxxx> wrote:
> Hello,
> I've been able to dig up any information on this, so perhaps I'm missing
> something, but I'm interested in using pygame for opengl rendering as well as for
> its font capabilities. I've been using the video flags "pygame.locals.OPENGL |
> pygame.locals.DOUBLEBUF | pygame.locals.HWSURFACE" up until now. In attempting to
> render text via:
> font = pygame.font.Font(None, 36)
> text = font.render(str("TEST DISPLAY"), 1, (200, 00, 00))
> textpos = text.get_rect()
> textpos.topleft = (50,20)
> self._screen = pygame.display.get_surface()
> self._screen.blit(text, textpos)
> pygame.display.flip( )
>
> I get the error:
> File "/....py", line 1066, in foo
> self._screen.blit(text, textpos)
> pygame.error: Cannot blit to OPENGL Surfaces (OPENGLBLIT is ok)
>
> I've tried adding "pygame.locals.OPENGLBLIT" to my video flags which removes the
> error but doesn't display anything either. I can only get this to work when I
> only use the double buffer flag, which doesn't help me without opengl support.
>
> Thanks in advance for any insight as to this issue,
> Cheers.
>
>
>