Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: How to code Paint in Opengl

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Johor
    Posts
    6

    How to code Paint in Opengl

    i need help to code a simple openGL program for Paint...can anyone help me please.
    lib

  2. #2
    Intern Contributor
    Join Date
    Apr 2002
    Location
    brooklyn, ny
    Posts
    65

    Re: How to code Paint in Opengl

    you don't use OpenGL for paint .. Use Win32 api for drawing stuff..

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    Johor
    Posts
    6

    Re: How to code Paint in Opengl

    but i need to use OpenGL for the project. its actually to code a simple paint program where i can generate circle, elipse, square, dashed line, dotted line and straight line but i have no idea how to start coding, i mean how to integrate the codings for each of this primitive data types.
    lib

  4. #4
    Guest

    Re: How to code Paint in Opengl

    The first step is to crosspost, this will get everyone mad and really rarin' to help you.

    Next, don't bother studying the material you probably have. Bothering other people to tell you things again is a better way to get information.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,070

    Re: How to code Paint in Opengl

    OpenGL is not a good for bitmap paint, but can be used to make vector drawings.

    You will need to setup a object array variable to store your drawn objects
    example:

    typedef struct
    {
    int type; // 0=line, 1= box, etc.
    int x1, y1, z1, x2, y2, z2; // 1 = first point of line or corner of box, 2 end point or corner.
    int color_r, color_g, color_b; //color of object.
    }Object;

    static Object Object_store[100]; // create space for 100 objects.

    Just read the mouse button, when down store the x,y from the mouse in x1,y1.
    When mouse button is released store the value in x2,y2.

    Originally posted by libra:
    i need help to code a simple openGL program for Paint...can anyone help me please.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •