Shop OBEX P1 Docs P2 Docs Learn Events
Simple Graphics Programming Guide Needed! — Parallax Forums

Simple Graphics Programming Guide Needed!

roboticsrobotics Posts: 90
edited 2010-07-07 19:00 in Propeller 1
Hi,

I would like to have my propeller Spin application produce graphics and text output on either a TV or VGA display but I have been unable to locate any really simple introductory material on this topic. I have examined the Spin coding of various graphics objects, but the general lack of of comprehensive documentation leaves the coding very cryptic. Any suggested tutorials or documentation geared to the beginner is greatly appreciated.

In advance, thank you!

Comments

  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-07-04 01:31
    It's easy! First of all, start with the template that I have attached for the Demo Board pinout. It is basically the Graphics Demo specs without any of the Graphics code. I use this as a starting point for all my Graphics programming. Now, get to know the basic commands. Open up the Graphics.spin object in the Propeller Library included with the Propeller Tool and click the "Summery" button that is at the top under the object tabs. This will give you a view of just the functions that you will need to use for the Graphics object. Now first things first, every Graphics program will need to start with a "Clear" function and end with a "Copy" function, as are included in the attached template around the comment that says "code goes here". The "clear" function does it's obvious purpose of clearing the display, and the copy function copies the scene you have created with the Graphics functions to the screen. The parameter for this is "display_buffer" as this constant is defined as the address of the memory that holds the screen image. This may sound obvious, but it was confusing for me, so I had better write it. smile.gif
    Now that you get that, you can add any graphics functions that you want to the middle of the clear and copy functions. Things like the Plot and Line functions are simple examples. Plot places a single pixel on the screen at location X and Y. Line draws a line from the last plotted pixel to location X and Y. Colorwidth sets the color (2 is white) and width sets the width of the lines and pixels (1 is standard). And so on with this. The Graphics object can seem confusing at some times, but it isn't. Read the comments below each PUB routine in the Graphics object for a detailed look at how they are configured and used.
    Sorry if I am unclear here, but it is late and I am sleepy. smurf.gif

    Micro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my new website!!

    Use the Propeller icon!! Propeller.gif

    Follow me on Twitter! Search "Microcontrolled"
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-07-04 01:59
    You might take a look at these two guides...

    They are geared toward gaming and animation, but are centered around graphics and text.

    www.propellerpowered.com/gaming.html

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Feature Projects: PropellerPowered.com
    Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
  • roboticsrobotics Posts: 90
    edited 2010-07-07 19:00
    For those having an interest in this thread, I spotted a great posting from Potatohead today that addresses some of the desires of this original posting. The link is http://forums.parallax.com/forums/default.aspx?f=25&m=466857

    Great work Potatohead!
Sign In or Register to comment.