Menu

Graphics programming

fhuerta
2004-05-20
2004-06-14
  • fhuerta

    fhuerta - 2004-05-20

    Hi all!

    I'm a newbie on the OpenTV platform, but I'm just  wondering if it is possible to make a more advanced graphics programming. I mean, the use of gadgets limits the performance of a complex videogame, for example.

    As long as ASM routines are allowed, maybe it could be a good idea to develop a graphical library in order to allow visual effects like fast animations, fade in/out, etc. Is this possible? Has anyone some information on this?

    Thanks a lot for your read and help... and keep the good work!
    Francisco

     
    • Chris van der Westhuizen

      Hi Fransisco,

      To your first question, I'm afraid the anwer is no.  OpenTV does not allow you access to setting pixels or any other graphics primitives.  You are limited to doing all graphics using shapes in gadgets.  I don't want to let everything I discovered to speed things up a bit out of the bag, but you have to work within these limits and think how you can improve the speed of things happening. Also do not forget about the video plane.  You can put a nice backdrop to your game by playing an MPEG I-frame on the video plane.  I have also heard some people made objects change in the video plane by using P-frames.  You'll have to be very clever with MPEG though.

      You can write assembler if you know the instructions of o-code.  This does not make things much faster than when using compiler optimization ( gcco -O2 for example).  The o-code instructions are still interpreted by the OpenTV RTE.  So animation does not get very fast.  Fade in/out should be possible with palette animation.

      Regards,
      DrOpen

       
      • Yannick DAGUILLON

        Hi Francisco

        In fact you can create a gadget containing only one shape of type ICON_SHAPE to emulate a frame buffer. The pixmap you use during creation of the gadget must be a RAW pixmap that you manually initialize with good values (i.e. you have to malloc the data field with enough memory). Then you can modify the framebuffer by setting bytes of the data field (data[y*bytesperline+x] = color for 256 colors display). When you want to refresh the screen (BitBlt operation) you have to call the O_icon_shape_set_pixmap function. The problem is that o_icon_shape_set_pixmap is not really fast so it will not really speed up your application but it will allow you to create some complex effect like soft scrolling.

        Regards,

        Yannick

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.