Jump to content


Photo

Is it possible to get the graphics context in e2 python plugins?


  • Please log in to reply
12 replies to this topic

#1 awx

  • Senior Member
  • 297 posts

+17
Neutral

Posted 1 December 2011 - 08:16

Does anyone know if there is a way to get the graphics context and draw directly to the screen in an e2 plugin?

Re: Is it possible to get the graphics context in e2 python plugins? #2 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 2 January 2012 - 12:01

push...

Would it be possible to compile SDL for enigma2?

Edited by neku, 2 January 2012 - 12:02.


Re: Is it possible to get the graphics context in e2 python plugins? #3 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 2 January 2012 - 12:13

on platforms with a plain framebuffer (no opengl), sdl means just adding an extra layer. It doesn't provide any advantages.

For a pc however, sdl makes sense (because it allows to use opengl, and because it allows to cooperate with a window manager)
See this thread
http://openpli.org/f...ntu-104-32-bit/

They are probably using sdl as well.

Re: Is it possible to get the graphics context in e2 python plugins? #4 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 2 January 2012 - 12:35

I though I maybe could compile my SDL game for enigma2.

So this is not possible?

Re: Is it possible to get the graphics context in e2 python plugins? #5 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 2 January 2012 - 13:19

'game' sounds like opengl, so almost certainly not.

Re: Is it possible to get the graphics context in e2 python plugins? #6 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 2 January 2012 - 13:27

AFAIK SDL is not based on opengl.
You can use openGL with SDL but you don't have to.

Re: Is it possible to get the graphics context in e2 python plugins? #7 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 2 January 2012 - 13:36

true, but what I said was sdl doesn't give any advantages on hardware without opengl support (and without a window manager). It just adds overhead on top of the framebuffer.

Re: Is it possible to get the graphics context in e2 python plugins? #8 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 2 January 2012 - 13:39

Is there a method how I could draw something on the framebuffer?

Re: Is it possible to get the graphics context in e2 python plugins? #9 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 2 January 2012 - 13:54

yes, but only using the stuff in lib/gdi
e2 is not designed to work with a 'window manager', and cannot share the framebuffer.

even though there is an SDL conditional in the e2 makefile, sdl is not used for the osd, only for media playback.

Re: Is it possible to get the graphics context in e2 python plugins? #10 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 5 January 2012 - 08:54

You could check what the teletext (tuxtxt) plugin does, it also directly writes to the framebuffer. You can get a FB lock and then just manipulate bits. If you want to run games, there is some hardware accellerated bitblitting possible, in particular fast 8-bit rendering is very interesting for sprites, and for emulators that expect an 8-bit framebuffer (which you could emulate by painting on a 8-bit surface and accellerated blt to the framebuffer, which also gives you double-buffering).

For example, the zx spectrum emulator should run well on these boxes, it ran fine on the Topfield which had only a 150MHz CPU and 8MB RAM.

You'll also need to spend time on implementing input devices, since they're not standard.
Real musicians never die - they just decompose

Re: Is it possible to get the graphics context in e2 python plugins? #11 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 5 January 2012 - 11:25

You could check what the teletext (tuxtxt) plugin does, it also directly writes to the framebuffer.


Good advice, but as far as I've seen the tuxtxt plugin is only as *.pyo available.

Re: Is it possible to get the graphics context in e2 python plugins? #12 MiLo

  • PLi® Core member
  • 14,055 posts

+298
Excellent

Posted 5 January 2012 - 11:36

opkg install enigma2-src
Real musicians never die - they just decompose

Re: Is it possible to get the graphics context in e2 python plugins? #13 neku

  • Senior Member
  • 181 posts

+2
Neutral

Posted 5 January 2012 - 12:15

Did that, but I cannot find the source...


3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users