473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

graphics is displayed in different window bgi in dev c++

8
i am using dev c++ ,so while i am working on graphics it gets diplayed in different window that is bgi window while input and output functions in normal output window what i want is both of them in one window . how do i do this ?
Oct 22 '09 #1
16 8485
Banfa
9,065 Expert Mod 8TB
You can't. By normal input output I assume you mean using stdin and stdout via scanf and printf (or similar functions).

stdin, stdout and stderr have to be read/written to a console window. Most programs with a GUI have no console and therefore can not display stdout or take stdin input.

Dev-C++, like most IDEs, takes extra steps to capture stdin/stdout/stderr and write them out to a Window in the IDE to provide extra information.
Oct 23 '09 #2
ckido
8
thank u banfa ...but then how do i do this? i am working on a quiz game project where input is required as well as graphics background and sound on the same screen ..how will i do this ...if it isnt possible in dev c++, i have tried turbo c++ also but sound function couldnt be added as error occured saying windows.h could not be opened. otherwise graphis and input operations are taking place in one window only .in turbo c++..please help me regarding this ..if i need to download it kindly tell me from where and which software will i need for carrying out th
is c++ project
Oct 28 '09 #3
Banfa
9,065 Expert Mod 8TB
Don't printf your output strings, draw them to your window using WIN32 API calls such as TextOut
Oct 28 '09 #4
ckido
8
even if i do this ,cin or scanf functions will take place in other window only...i want all in one window only printf is getting replaced by other functions
Oct 29 '09 #5
Banfa
9,065 Expert Mod 8TB
You are using a GUI, that is Graphical User Interface.

Use the facilities provided by the GUI. It has methods to output data, TextOut etc and it has methods to input data such as Text Boxes or just intercepting the WM_CHAR messages that are produced when keys are pressed.

Forget about printf, scanf, cin and cout and read the documentation on the system you are using.
Oct 29 '09 #6
ckido
8
tried a lot searching for an input function used in graphics but no help...please provide me the function name with syntax so i can carry forward my project
Oct 31 '09 #7
newb16
687 512MB
As I understood, you are using dev-c++ bgi, that is some sort of Borland BGI API emulation under Windows, that provides you with some fixed size window that you draw on using BGI functions. In this case, you have either to program some 'control' using bgi functions that will allow you to enter one or more lines of text, or dive into sources of this BGI-WIN32 library and use win32 functions to make window of desired class with calls like CreateWindow( "edit", "",
WS_VISIBLE|WS_CHILD|WS_BORDER|WS_VSCROLL|WS_HSCROL L|
ES_MULTILINE|ES_WANTRETURN|ES_AUTOHSCROLL|ES_AUTOV SCROLL,
0, 0, nClientWidth, nClientHeight, hwnd, (HMENU)nEditID, hInstance, NULL);
Oct 31 '09 #8
ckido
8
i just wanted to combine all i/o operations ,graphics ,sound in one window only.i dont want to create a special window for it . c using turbo c++ i made it all in one window but play sound() wasnt availaible...when i tried it in dev c++ all i /o functions + sound was being performed in one window but graphics in other ..what i want is all in one window ..pls tell me how do i do this ?
Oct 31 '09 #9
ckido
8
i understood what u meant by use graphic facilities but that i can use for output which can also be achieved through outtextxy but pls tell me about the input function in graphics ....
Oct 31 '09 #10
newb16
687 512MB
Input functions? Getch, kbhit or what else dev-c++ has similar to those of Borland C. Then you read keyboard code, detect printables/controls, and draw 'current input string' according to it until user presses 'Enter'. And yes, draw cursor too. No, you don't need to make it blink.
Ps - sound is not 'performed' in some particular window.
Oct 31 '09 #11
ckido
8
not that input functions i meant the input function which receives data like scanf so i want the substitute for scanf in graphics like there is for printf :outtextxy,textout but what is for scanf ..please tell me
Nov 2 '09 #12
newb16
687 512MB
What if there are no such functions that can replace (in his context) scanf() 1:1 without additional work? You have to make them yourself (see post #11). It's unlikely that even if someone have implemented such replacement, he will be able to share it with you.
Nov 2 '09 #13
ckido
8
i am using dev c++ , i want to clear my graphics screen how do i do this ? i have tried system("cls") but it didnt work and even tried adding conio.h plus linking it but i got these errors
2 C:\Dev-Cpp\choc 1.cpp conio.h: No such file or directory. what should i do please help me linking to its library
Jan 14 '10 #14
Banfa
9,065 Expert Mod 8TB
Have you tried calling InvalidateRect? Alternitively you draw the background colour to the whole screen.

Please stop trying to use console functions on your graphics window they are never going to work properly if at all.
Jan 14 '10 #15
johny10151981
1,059 1GB
Hi ckido,

Try to add WM_KEYUP notification. From here you can operate your gaming issue(if you use Windows Application)

http://msdn.microsoft.com/en-us/library/ms646281%28VS.85%29.aspx
Jan 14 '10 #16
have you tried clearviewport();
Apr 27 '20 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: George Hester | last post by:
http://home.nycap.rr.com/foryorisonly/site.htm The top one is very different from the bottom one. If you do not recognize the difference scroll the images to the right. Not that the toolbar...
2
by: Dragon | last post by:
Hello world! 8-] I'm trying to create a form that will have different window class. I have overridden the CreateParams property of a form as follows: ~ Protected Overrides ReadOnly Property...
0
by: saikat | last post by:
I in a prob. I want to run jboss by ant but in a different window, so that I can open a page in Intenet explorer. My code is... <target name="startJBoss"> <exec...
3
by: patrickst1 | last post by:
Ok, so I am really and truly a beginner at C#. I have been programming for some time but just beginning to learn this language. Here is what I am trying to accomplish. I have created a little...
2
by: radhikams | last post by:
Hi I have a html file in some location into which i do read and write operations...Now when i download that file it is getting displayed in the same browser... I want that in a different...
2
by: dnnddane | last post by:
Hi All, I try to create a sample asp.net ajax application in visual studio 2005. I have 1 textbox, 1 requirefieldvalidator and 1 button. All are in updatepanel. When I click the button and the...
20
Nepomuk
by: Nepomuk | last post by:
As Linux and the various flavours of Unix are slowly spreading into the world of personal computers, I thought we could collect a few Tips and Tricks here to help each other making the best out of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.