Shop OBEX P1 Docs P2 Docs Learn Events
2bitbitmapdemo plus graphics???? — Parallax Forums

2bitbitmapdemo plus graphics????

sccoupesccoupe Posts: 118
edited 2008-12-01 01:10 in Propeller 1
I am messing with rayslogic's 2bitbitmapdemo.spin and with a little of his help have been able to convert a bmp and display it on the screen properly. Now I want to put some vector graphics over it with the graphics object. I can use the graphics object alone, no problem, but when added to the 2bitbitmapdemo, I get wierd results. A simple line is segmented and displayed all ove the place. Also, if I just gr.clear the doesnt clear the entire bitmap. I have been able to change what part of the screen that it clears by messing with the bitmap_base value needed for the gr.setup. I have also had different result by messing with other gr.setup values but cant get what im lookin for. I need the graphics object to write to the same "screen" as the bitmap is displayed on. Any clues on what im doing wrong? The code is attached.

Thanks all.

Jason

Comments

  • BaggersBaggers Posts: 3,019
    edited 2008-11-30 21:52
    That's mainly because graphics.spin is for the parallax tv drivers. you'd need to modify graphics.spin to use whatever display layout rayslogic's 2bitbitmapdemo.spin is using ( i'm assuming top left to top right, then down one scanline and repeat. )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2008-11-30 22:09
    Go and search for the Amazing Sand! demo. Dennis wrote it, and basically he modified both the graphics library, and the TV driver to work with a linear memory mapped frame buffer.

    That's probably the closest code that exists for what you want to do. Works on 1 bit per pixel and 2 bits per pixel.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • sccoupesccoupe Posts: 118
    edited 2008-11-30 22:34
    Thanks,· im still digging on this stuff.· What would really do me would be a tool that converted line art bmp's or jpg's onto vector commands for graphics.spin. [noparse]:)[/noparse]· Anyone have anything like this? The graphics demo is very easy to grasp and modify. I probably messed up going with the 2bitbitmapdemo because now I understand how to use two objects but not really understanding how they work "under the hood". So, now I need them to work together and its a road block for the newb.

    Thanks

    Jason
  • RaymanRayman Posts: 14,826
    edited 2008-11-30 22:35
    That's an interesting idea...

    I think it might work.

    But, this line looks wrong:

    ·· gr.setup(20, 128, 96, 40, bitmap_base)

    You don't really want 128 y tiles, right?
  • sccoupesccoupe Posts: 118
    edited 2008-11-30 22:40
    127 y tiles doesnt sound right to me but thats what was used in the graphics_demo.spin, so I went with it.
  • RaymanRayman Posts: 14,826
    edited 2008-11-30 22:54
    Here's what I have in graphics_demo.spin:
    gr.setup(16, 12, 128, 96, bitmap_base)
  • sccoupesccoupe Posts: 118
    edited 2008-11-30 23:02
    Ah yes,· you are correct. I have dyslexic eyes or something from looking at this code for my entire thanksgiving vacation. [noparse]:)[/noparse]

    It looks like I goofed those numbers as I messed around trying to get the line to display correctly. I have this corrected with what im working with but forgot to correct it before I posted the attachement.
  • RaymanRayman Posts: 14,826
    edited 2008-12-01 00:10
    The other thing you'll have to do is start graphics pointing to bitmap instead of "bitmap_base"... That way graphics will draw on top of the bitmap...
  • sccoupesccoupe Posts: 118
    edited 2008-12-01 01:10
    Attached is the code with a couple of changes as well as the picture data file that im using and a screenshot of the screen that I get with the bitmap displayed as well as a line drawn in white with graphics.spin from 0,0 to 50,50. Perhaps this may help?



    Thanks



    Jason
Sign In or Register to comment.