Thread: Simple shapes, will C suffice?

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    1

    Simple shapes, will C suffice?

    Hi everyone, this is my first post. My background is in C++ and C but I have never needed to write a program to display graphics and so I'm not sure what is my best option. All I want to do is to draw a polygon in 2D, change its colour and move a smaller 2D polygon around the screen. The problem is that this will most likely be on a microcontroller based project and therefore plain old C. I know I can do exactly what I want on a pc with say Visual C++ but is it possible to do this in pure C? Many thanks for your help.

  2. #2
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    I've previously worked with graphics in C but that I did with TC. There's a header <graphics.h>which has all of the graphics related functions. You can try a hand on it.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  3. #3
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    It's possible to do this in plain C on most machines too - you just have to make the right function calls. Now, your microcontroller probably doesn't have DirectX 10 on it, so you're going to have to find out what functionality it has, and how to go about drawing to the screen.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    115
    I still have a TC compiler if you need it I may send it to your e-mail... pm me if so..

  5. #5
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by $l4xklynx View Post
    I still have a TC compiler if you need it I may send it to your e-mail... pm me if so..
    Why would you? It's a terrible compiler these days. I would suggest you keep it for yourself

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 11:48 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Simple simple program
    By Ryback in forum C++ Programming
    Replies: 10
    Last Post: 09-09-2004, 05:48 AM
  5. Need help with simple DAQ program
    By canada-paul in forum C++ Programming
    Replies: 12
    Last Post: 03-15-2002, 08:52 AM