Page 8 of 14 FirstFirst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 LastLast
Results 211 to 240 of 418
  1. #211
    Bored boar aboard! Kl@w-24's Avatar
    Join Date
    Apr 2004
    Location
    Pune
    Posts
    1,604

    Default Re: Turbo C/C++ graphics distorted

    Try removing the restorecrtmode(); line.
    Chelsea FC: Blue Is The Colour

    The Ordinaree - A dead blog It's alive | Flickr!

  2. #212
    Apprentice
    Join Date
    May 2007
    Posts
    84

    Default Re: Turbo C/C++ graphics distorted

    damm what is wrong with people here? just download and install bloodshed for windows or geany for linux and get done with it!!

    all these people trying to make a prehistoric piece of software work is just wrong!

    why are u stuck to something which was made in like 1990 just because others use it? pffft..

  3. #213
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    removing restore command not working....

    2ndly, that bgi archive not working....says its corrupt...

    3rd....trying bloodshed if possible

    Enjoy~!
    No Pain...No Gain

  4. #214
    Bored boar aboard! Kl@w-24's Avatar
    Join Date
    Apr 2004
    Location
    Pune
    Posts
    1,604

    Default Re: Turbo C/C++ graphics distorted

    The BGI archive is alright, I just downloaded it!!
    Chelsea FC: Blue Is The Colour

    The Ordinaree - A dead blog It's alive | Flickr!

  5. #215
    Legen-wait for it-dary! dheeraj_kumar's Avatar
    Join Date
    Dec 2004
    Location
    Chennai
    Posts
    2,470

    Default Re: Turbo C/C++ graphics distorted

    Offtopic, but he actually installed latest nvidia drivers so he could run BGI graphics... I salute you man, you just redefined the meaning of "graphics card".
    If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file

  6. #216
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    @dheeraj: thank you

    will try bgi again but i guess tats not issue....bgi files r present only thing they aint in seperate folders...al mixed up

    Enjoy~!
    No Pain...No Gain

  7. #217
    Legen-wait for it-dary! dheeraj_kumar's Avatar
    Join Date
    Dec 2004
    Location
    Chennai
    Posts
    2,470

    Default Re: Turbo C/C++ graphics distorted

    Er... speedyguy, I was being sarcastic.
    If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file

  8. #218
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    i was too dude....sorry fr being ignorant 2 ur sarcasism but may be aftr gettin my things resolved i'll join u....

    Enjoy~!
    No Pain...No Gain

  9. #219
    GaurishSharma.com gary4gar's Avatar
    Join Date
    May 2005
    Location
    Jaipur
    Posts
    4,097

    Default Re: Turbo C/C++ graphics distorted

    Did you try Dosbox?

    An open source DOS emulator for BeOS, Linux, Mac OS X, OS/2, and Windows. Primarily focuses on running DOS Games.
    I am using this for running TC in Ubuntu. I believe there is a windows port also.
    It runs DOS programs very well with alomost zero configrations.

    It even runs those 16bit games, which stopped running since Windows NT

  10. #220
    18 Till I Die............
    Join Date
    Jul 2004
    Location
    India, Mumbai, Marine Lines
    Posts
    5,792

    Default Re: Turbo C/C++ graphics distorted

    Quote Originally Posted by dheeraj_kumar View Post
    Er... speedyguy, I was being sarcastic.
    Were you? I thought you were never sarcastic.
    http://www.bash.org/?258908

  11. #221
    Alpha Geek Krazy_About_Technology's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai - India
    Posts
    780

    Default Re: Turbo C/C++ graphics distorted

    Dude, remove the clrscr() from there and put cleardevice() inplace of it. Also at the end of program call restorecrtmode() after calling closegraph(). That will help i think. And that BGI directory stuff won't matter. I have seen people having two types of installation of TC++, one that contains all the files in the same dir and other which contains files in different subdirectories. Both versions work fine as long as path is set right at all the places. so if you have all the files in, say, c:\tc then specifying c:\\tc in initgraph will work, provided that the driver file egavga.bgi is present in the directory.

    I hope this clear things up for everyone. Correct me if i am wrong somewhere
    Laptop: Lenovo G580 - Core i5 Ivy Bridge 3210M (2.5 - 3.1 GHz), 4 GB RAM, 500 GB, Intel HD 4000 Graphics, 15.6" LED Display :)
    OS: Genuine Windows 8 Pro 32 Bit, Fedora Linux 17 32 Bit.
    Phone: HTC Sensation (ICS 4.0.3, Sense 3.6), 1 GB per Month 3G/HSDPA
    Internet: Mumbai : Airtel 2 MBPS / 24 GB @ Rs. 1050 Plan, Tata Photon+ 3.1 Mbps

  12. #222
    Legen-wait for it-dary! dheeraj_kumar's Avatar
    Join Date
    Dec 2004
    Location
    Chennai
    Posts
    2,470

    Default Re: Turbo C/C++ graphics distorted

    Quote Originally Posted by mehulved View Post
    Were you? I thought you were never sarcastic.
    Oh, I think you are being sarcastic. Because I am most of the times.

    All right, lets stop this now, I dont want to spam this thread with more offtopic stuff.
    If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file

  13. #223
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    @Krazy_About_Technology : placing cleardevice() is not bringing up the output screen...it compiles n remain at editor screen....restorecrtmode is kept aftr closegrph function...

    Enjoy~!
    No Pain...No Gain

  14. #224
    Fresh Stock Since 2005
    Join Date
    Feb 2005
    Posts
    1,015

    Default Re: Turbo C/C++ graphics distorted

    I used TC Graphics for my Galaxian-Like game for the 1st sem project in C..

    This sem (3rd) we decided to code Mario .. no wonder it was barely possible to scroll the screen and load bitmaps and all.. So went for Allegro Gaming Library... It has a manual and examples.. Mario is almost complete...

    I suggest u to dump TC graphics and use Allegro..
    http://www.khattam.info

  15. #225
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    can u tel me if thrs diff betn allegro, bloodshed n tc as far as coding is concerned...coz i know coding via tc only....

    Enjoy~!
    No Pain...No Gain

  16. #226
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    hi again,

    time has come for me now 2 get in2 graphics for my projects n i still havnt got rid of my issues....plz help me out if thrs an alternative 2 turbo c++ fr graphics...iv tried borland visual but no help as yet...

    m posting a proper detail of wat issues m facing wit visuals...plz take a carefull look...

    this is on editor windows(turbo c++) wit a dda/bresenham program for linedraw-


    this is now into output screen wich is already seen distorted....try 2 read..."enter end points ......... "


    this is aftr providing the inputs...u can see d required line but again its distorted at top...it cn b randomly anywhr...
    [img=http://img403.imageshack.us/img403/2959/img1353wf8.th.jpg]

    and now back 2 editor window...eew! can u even see anything....ts all messed up....dunno wat d hecks wrong...


    more observations - wen i press alt-enter aftr this 2get 2 windowed screen it gets back 2 normal wit d editor window.....

    as soon as i use initgraph....the screen behaves like this.....

    my system is (again)-

    amd turion64 X2 1gb ddr2,
    nVidia geforce go 6150,
    hp pavilion tablet pc (tx1000 series)
    12" lcd screen...

    thanx,

    Enjoy~!
    No Pain...No Gain

  17. #227
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    hi plz reply if any small idea u have...

    thrs one more observation i saw....thr problem is not wit my coding....ts wit my DOS graphics....even other Dos based games r not working in ma system....

    Enjoy~!
    No Pain...No Gain

  18. #228
    Right Off the Assembly Line
    Join Date
    Oct 2008
    Posts
    1

    Default Re: Turbo C/C++ graphics distorted

    ive been experiencing d same problem...
    ive got d same Geforce 6150
    its exactly d same... hve been trin all sorts line drawing/clipping algo's ... none of my graphics programs r wrkin fine... may b its a hardware issue...
    hve exams comin closer day by day... nd ders no place to practice

    do u hve ny alternative 4 dis?

  19. #229
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    thrs no issue wit bgi graphics in c++....the graphics in dos is screwed up wit ur system....mine too.....try dos based games even they wont work...

    try booting in safe mode wit command prompt n c if it can work wit c++...

    else use DosBox Emulator.....that shud work...

    Enjoy~!
    No Pain...No Gain

  20. #230
    Traceur zegulas's Avatar
    Join Date
    Oct 2003
    Location
    Mumbai
    Posts
    282

    Default Re: Turbo C/C++ graphics distorted

    @speedguy did DosBox worked for you?
    Parkour: A journey started by two & followed by many...

  21. #231
    Wise Old Owl speedyguy's Avatar
    Join Date
    Aug 2004
    Location
    Bangalore/Jamshedpur
    Posts
    1,227

    Default Re: Turbo C/C++ graphics distorted

    ya dosbox worked fine...but it reduces executing speed....so not gettin exact idea abt its speed wit other systems...

    Enjoy~!
    No Pain...No Gain

  22. #232
    zzzzzzzzzz........ garfield_56's Avatar
    Join Date
    Nov 2008
    Posts
    41

    Default Turbo C/C++ and other junk compilers discussions and queries here

    hey all,
    m learnin c++...i wantd to ask wat is the role og "getch()" in a program.....
    i mean most of the programs mentioned in buks nd even on websites don't have a "getch" wriiten before closing main()....but i hv seen dat to get d desired result....i always have to add dis......

    why is dis so?? nd is it necessary????

  23. #233
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,451

    Default Re: getch() in c++

    turbo c require getch() and ansi c compilers don't. Find out why ? Just do it and see for yourself
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

  24. #234
    zzzzzzzzzz........ garfield_56's Avatar
    Join Date
    Nov 2008
    Posts
    41

    Unhappy Re: getch() in c++

    Quote Originally Posted by T159 View Post
    turbo c require getch() and ansi c compilers don't. Find out why ? Just do it and see for yourself


    ok...i am using turbo c..((seems like m a total newbie))...

    if i may ask.........y do v use so many diff compilers (borland, ansi, turbo,etc...)???

  25. #235
    Back! red_devil's Avatar
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    510

    Default Re: getch() in c++

    Quote Originally Posted by garfield_56 View Post
    hey all,
    m learnin c++...i wantd to ask wat is the role og "getch()" in a program.....
    did u google ??

    Quote Originally Posted by garfield_56 View Post
    but i hv seen dat to get d desired result....i always have to add dis......
    are u sure ?? did u try to see what happens when u dont add getch() to your program ??

  26. #236
    Wise Old Mouse mrintech's Avatar
    Join Date
    Sep 2005
    Location
    Bhopal, India
    Posts
    2,081

    Default Re: getch() in c++

    getch() is used for obtaining the desired output

    Try removing any of the header file iostream.h and conio.h and see which header file supports getch()
    MrinTech | Exam Dunia :)

    Some gadgets I own: Dell Inspiron 15R | Asus X53U-SX013D | iPad 2 | Samsung Galaxy S+ | PS3 :)

  27. #237
    zzzzzzzzzz........ garfield_56's Avatar
    Join Date
    Nov 2008
    Posts
    41

    Default Re: getch() in c++

    are u sure ?? did u try to see what happens when u dont add getch() to your program ??[/quote]




    yup...i did......


    wen i 5run d progrm (a normal & simple c++ prog..) a blank screen appears for 2-3 sec nd then it goes bak to my program screen....

  28. #238
    Back! red_devil's Avatar
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    510

    Default Re: getch() in c++

    ^^ so see.. now u know what the use of the getch() is in your program...


    anyways, basically, getch is used to single-byte character from the terminal ... so once u add getch, your output screen waits for you to enter a key (which normally is the enter key)
    so once u hit enter, the screen is no longer there.

    btw, when u dont add getch(), it doesn't mean that your program isn't correct or anything...only your output window doesn't wait for you to take your own time to read all the output that you get...

    hope now u've understood what the use of getch() is.

    and btw, use system("pause") instead of getch() and check out what happens

  29. #239
    Commander in Chief QwertyManiac's Avatar
    Join Date
    Jul 2005
    Posts
    6,657

    Default Re: getch() in c++

    This thread was not supposed to have so many posts, damn you T159! It doesn't have anything to do with ANSI/non-ANSI

    getch - get a single-byte character from the terminal.

    When you call getch() (A Windows Platform-only function), it goes into an input event loop and waits for a single character to be entered (and pressed). And it stores that character into a variable, or discards it if you haven't provided one, like in these cases:
    Code:
    #include <iostream.h>
    #include <conio.h>
    
    void main() {
    char c;
    c = getch(); // Gets and stores a user-input character
    cout << c << endl;
    cout << "Press any key to exit.";
    getch(); // No variable, used to get into an input-event loop.
    }
    Input-loop as in it goes into a wait-for-user-to-press-a-key mode. You can see it like the behaviour of some applications that say "Press any key to continue...".

    Quote Originally Posted by garfield_56
    wen i 5run d progrm (a normal & simple c++ prog..) a blank screen appears for 2-3 sec nd then it goes bak to my program screen....
    When Turbo C runs a program for you, it returns to the editor immediately after the program exits a.k.a the end of main(). So it will appear like your program has started and terminated all of a sudden after your input is given.

    As you yourself said, "to get the desired result" which here, is to wait for the user to see the final output, we use a getch(). To give that "Press any key when you have seen the output and exit" effect. Thats all there is to its use in Turbo C programs.

    If you ran your compiled program via normal DOS mode, you won't need this feature.

    For an example, try running a program without a clrscr() function. You will see the old successful output (upon successive runs), meaning it has nothing to do with the program's working.

    Quote Originally Posted by garfield_56
    if i may ask.........y do v use so many diff compilers (borland, ansi, turbo,etc...)???
    You do know compilers are platform-dependent and also architecture-dependent. Code might not be but compilers are. Thus, there came out several multi-featured platform-specific compilers after the C++ language was developed. These specialized compilers like borland aimed to provide good pre-built libraries for programmers to use.

    The standard compiler (like ANSI) contains only those functions that can run across all platforms, from OSX to Linux. These specialized compilers come for one specific platform, like Borland for Windows. And they provide Windows-usable special functions, of which things like getch() are a part of.

    For learing, using a standard compiler (GNU C Compiler for example) is the best practice, so that what you learn is all things standard (works across all OS) and you won't develop dependence on some particular OS-specific function like getch(). This is but one of the many reasons why people keep recommending them.

    Note: Do read my entire post. Not this line alone.
    Harsh J
    www.harshj.com

  30. #240
    Back! red_devil's Avatar
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    510

    Default Re: getch() in c++

    ^^ now that is one detailed explanation

    btw, i read half your post and of course the last line

Page 8 of 14 FirstFirst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 LastLast

Similar Threads

  1. Why is this program rejected by C++ compilers?
    By gopi_vbboy in forum Lifestyle
    Replies: 13
    Last Post: 03-05-2012, 12:23 AM
  2. compilers
    By arpanmukherjee1 in forum Programming
    Replies: 1
    Last Post: 26-09-2008, 09:31 PM
  3. Where to get C++ compilers?
    By redhat in forum Programming
    Replies: 12
    Last Post: 19-09-2008, 07:01 PM
  4. Compilers For C And C++ ?
    By clmlbx in forum Programming
    Replies: 31
    Last Post: 26-01-2008, 07:25 AM
  5. C/C++ compilers for win xp x64
    By setharsh in forum Software Q&A
    Replies: 5
    Last Post: 22-12-2006, 02:25 PM

Bookmarks

Posting Permissions

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