#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    8
    Rep Power
    0

    Graphic functions in C


    hello
    I am learning mouse programming in C.
    But the problem is there are so many graphic functions involved with the mouse programming.
    I am having a tough time.
    I need a proper documentation of all the graphic functions used parallely with mouse programming.
    for example,
    functions like initgraph(), cleardevice(), graphresult(),initmouse() etc. plus all the macro definitions.
    I tried to find out on the internet but wasn't able to do so.
    Thanks.
  2. #2
  3. המבין יבין
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2001
    Location
    Haifa
    Posts
    2,085
    Rep Power
    1488
    Have a look at this page:
    http://www.cs.iitm.ernet.in/~snaresh/source/mouse.html

    It has everything right there in the code.
    . . . What is Firefox?
    . . . . . . What is Linux?
    . . . . . . . . . . . What is Love?
  4. #3
  5. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,444
    Rep Power
    1874
    > I am learning mouse programming in C.
    Which OS?
    Which compiler?

    Those routines belong to TurboC and DOS, is that what you really want to be using?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    8
    Rep Power
    0
    Originally Posted by salem
    > I am learning mouse programming in C.
    Which OS?
    Which compiler?

    Those routines belong to TurboC and DOS, is that what you really want to be using?
    I am using turbo C and MS DOS but i really have no idea how to deal with these library functions in C.
    I want details of all the library functions in C including graphics, file handling, I/O Functions, DOS interface functions and data conversion functions.
    Can anybody help me.
  8. #5
  9. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,444
    Rep Power
    1874
    > I am using turbo C and MS DOS but i really have no idea how to deal with these library functions in C.
    What - real DOS, completely untainted by any kind of windows OS running beside it, under it, on top of it?

    It's not that black rectangle in the middle of your XP desktop with a C:\> prompt in it?
    Because that isn't DOS at all.

    If that describes your situation, then I suggest you download dev-c++ compiler/IDE and then grab the LibSDL devpak to get a graphics library. You can read all about those here and here
    http://www.bloodshed.net/devcpp.html
    http://www.libsdl.org/index.php
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    8
    Rep Power
    0
    Originally Posted by salem
    > I am using turbo C and MS DOS but i really have no idea how to deal with these library functions in C.
    What - real DOS, completely untainted by any kind of windows OS running beside it, under it, on top of it?

    It's not that black rectangle in the middle of your XP desktop with a C:\> prompt in it?
    Because that isn't DOS at all.

    If that describes your situation, then I suggest you download dev-c++ compiler/IDE and then grab the LibSDL devpak to get a graphics library. You can read all about those here and here
    http://www.bloodshed.net/devcpp.html
    http://www.libsdl.org/index.php

    You are right. Its the same black rectangle I am talking about.
    Thanks for the websites Salem
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2006
    Location
    bucharest
    Posts
    1
    Rep Power
    0

    drawing with mouse


    hello everybody!

    i have a big problem and i need help!
    i have a program in c language and i must draw a polygon with the mouse.when i press left click it starts the line,and when i press right click it finish the line.
    i'm beginner in c ...please,help me!!!

    10x a lot!!
  14. #8
  15. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,323
    Rep Power
    2225
    Originally Posted by emporia
    hello everybody!

    i have a big problem and i need help!
    i have a program in c language and i must draw a polygon with the mouse.when i press left click it starts the line,and when i press right click it finish the line.
    i'm beginner in c ...please,help me!!!

    10x a lot!!
    1. Start your own thread to ask for help.
    2. State your operating system, compiler, and target environment (eg, Windows, X-11, Mac whatever, whatever).
    3. Show us the code you have already written to accomplish this homework assignment. Use code tags.

    We don't do people's homework for them. And even if we did, it wouldn't help them because they would not have learned anything. However, if they demonstrate that they are making an effort to do it themselves, then we will gladly help with specific problems or specific questions.
  16. #9
  17. No Profile Picture
    Redpill
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2005
    Posts
    1,657
    Rep Power
    154
    You should try the Win32 API which allows you to create a GUI app in Windows and handle various mouse (as well as other system device) events seamlessly, instead of using obsolete Turbo DOS hacks. Or use GTK/SDL/wx to get a platform-independent solution, instead of letting yourself be stuck thinking in a tiny black box.
    Code:
    #include <stdio.h>
    int main(int o,char**O){return o>-1?o-2||!main(-1,1+O)?!!fprintf(stderr,"%s [0-"
    "9]{81}\n",*O):main(-83,++O):o>-83?(*O)[-1-o]?81==(o=-o-1)||o[*O]<'0'||'9'<o[*O]
    ?0:main(-2-o,O):o==-82:o>-164?(*O)[-83-o]<'1'?main(o-82,O):main(--o,O):o+164?o>-
    246?(*O)[-165-o]<'1'?main(o-82,O):main(--o,O):o+246?o>-328?(*O)[o=-o-247]<='8'?(
    main(-328-o,(++o[*O],O)),main(-247-o,O)):!(o[*O]='0'):(o=-o-328)<729?(o%9/3*3-o%
    27+o/243*9+o/81%3&&(*O)[o%81]==(*O)[o%81-o%27+o%9/3*3+o/243*9+o/81%3])||(o%81-o%
    9-o/81*9&&(*O)[o%81]==(*O)[o%9+o/81*9])||(o/81-o%9&&(*O)[o%81]==(*O)[o%81-o%9+o/
    81])?0:main(-409-o,O):main(-165-o%81,O):!puts(*O):0                           ;}

IMN logo majestic logo threadwatch logo seochat tools logo