From: Ken Bloom Date: 2009-12-03T11:08:44+09:00 Subject: Re: Graphics mode On Thu, 03 Dec 2009 00:49:57 +0900, Teodor Carstea wrote: >>C++ doesn't have a way to "initialize graphics mode" > > Well, this is the way I do it in C++: > > #include > void main(){ > //initializing graphics mode > int gdriver=DETECT, gmode, errorcode; > initgraph(&gdriver, &gmode, "C:\\Progra~1\\BORLANDC\\BGI"); errorcode > = graphresult(); > if(errorcode!=grOk) { > cout<<"Graphics error!!!\n" > <<"Press any key..."; > getch(); > exit(1); > } > //... > //AND HERE IS DA MAIN PROGRAM CODE. > //... > } > > I'd like to make my ruby prog like this. Any Ideas? P.S.: If you have an > idea, please describe it in a way you would talk to a noob, for I'm > really green. Plus, I use Ubuntu, no comment. > > Thanks! Wow! That's a blast from the past! I'm guessing it's either Borland C++ for DOS (where screens actually did have "graphics mode" versus "text mode"[1]) or their library for Windows which simulated the old DOS library by opening up a window and drawing in that window. (I programmed for this emulation library 10 years ago as part of an AP computer science assignment.) I'm guessing that you're moving from your knowledge of old DOS/Windows and C++, you're moving to Linux and now you want to learn a nice shiny new language for programming in Linux, so you chose Ruby. If you're planning on writing GUI applications, you should either look at Ruby/GTK+ or QTRuby, both of which are good frameworks providing all of the standard widgets that you find in word processors, web browsers, and the like. http://ruby-gnome2.sourceforge.jp/ http://techbase.kde.org/Development/Languages/Ruby If you want full screen graphics (or full-screen graphics in a window), which is often useful for game programming, you should look at Ruby/SDL. http://www.kmc.gr.jp/~ohai/rubysdl.en.html Ultimately you should take the time to learn a little of both. [1] FWIW, Linux has this too, but you only think about it that way if you're writing an X server or programming in svgalib. For the most part that view of the world is obsolete by about 20 years. -- Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/