Jump to content
  • Advertisement
Sign in to follow this  
TIMPAN

Please help me

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ummm ... this is my first post , well I got this problem with handles input , output you know ... I can't seem to learn em , how did you do to learn em ? I am following the tutorials on www.gametutrials.net . Any hints ??? Here is the tutorial ; is this newbie stuff ? I erased all the commets , done by TheTutor at gametutorials.net // Done by TheTutor -- 4/26/03 #include <windows.h> // windows.h contains our DOS friendly functions that we will use #include <iostream> using namespace std; int main() { HANDLE input_handle; HANDLE output_handle; INPUT_RECORD input; COORD pos; DWORD info; CONSOLE_SCREEN_BUFFER_INFO screen_info; input_handle = GetStdHandle(STD_INPUT_HANDLE); output_handle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO to be filled GetConsoleScreenBufferInfo(output_handle,&screen_info); SetConsoleMode(input_handle, ENABLE_PROCESSED_INPUT); while(1) { pos.X = screen_info.srWindow.Right / 2 - 5; pos.Y = screen_info.srWindow.Bottom / 2; SetConsoleCursorPosition(output_handle,pos ); // actually read. ReadConsoleInput(input_handle,&input,1,&info); if(input.Event.KeyEvent.bKeyDown) { char theChar = (char)input.Event.KeyEvent.uChar.AsciiChar; for(int i = 0; i < 10; ++i) cout << theChar; } } return 0; } /*----------------------------*| TheTutor | | thetutor@gametutorials.com | | © 2000-2003 GameTutorials | \*----------------------------*/ CRAZY stuff if ask me ,,, way to hard to take in all at once !!!

Share this post


Link to post
Share on other sites
Advertisement
I don't think that a 'tutorial' like this is helpful at all.
First of all it uses Win32 specific API calls only (no std. C/C++ I/O stuff). Secondly it is poorly written (non-std. main() signature, infinitive main loop with no exit condition, ...).

Learn C or C++ basics instead of legacy API crap like that.


The above comment is very subjective. There might be people who think that stuff like that code you posted is actually useful.

Good luck anyway,
Pat.

Share this post


Link to post
Share on other sites
>>The above comment is very subjective. There might be people who think that stuff like that code you posted is actually useful.

Not me
I agree totally.

Share this post


Link to post
Share on other sites
Aww hey ... usefull or not I am gonna learn it like anything else :-) . And plus I got a commet " use cin and count "
_ Am I gonna do a text game ??? Yes I will but hey .. just asking since I'm going thrug all the www.gametutorials.net so I will someday get to the nitty stuff ... Meanwhile I will keep on ground zero since IMO it is very important to have solid ground to stand on , even if it's a forgot API or whatever someone said.
And plus if I just use cout and cin I woulden't be able to force the user to use the keyboard and what fun is that , not impossible but IMO the user shuld have an large amount of ways to express actions , not to many thu ... the amount of actions should increse under the games jurney :-) . And it's always good to try to do something creative with the knowlage you got , but never be passive to learn new things :-) !

Share this post


Link to post
Share on other sites
Umm I seemd like you guys thought that I was a total noob but this is some of the things I have masterd so far


First C++ Program / Done

Keyboard Input / Done

For Loop / Done

For Loop Part2 / Done

While Loop / Done

While Loop Part2 / Done

Do While Loop / Done

If Statement / Done

If Statement Part2 / Done

Switch Statement / Done

Conditional Statements / Done

Operator Precedence / Done

Binary Operators / Fuggy logic

Preprocessor Directives / Done

Strings / Done

Functions / Done

Functions Part2 / Done

Random Numbers / Done

Macros / Can't remember ...

Random Numbers and Macros / Done

Arrays / Done

Structures / Done

Reading From a File / Done

Reading From a File Part2 / Done

Writing to a File / Done

Recursion / Done! Easy

Ternary Operator / Done

Pointers / Done

Pointers Part2 / Done

References / Some tactics are undefined

Dynamic Memory / Done

< YOU ARE HERE >

Introduction to Console Functions


Where there is an Done after I fully understand and I also improve , I am not the one who made this learning list the friendly people at gametutorials did ! I am not braging but I
just thought you'd be should know why I am learning this ... so please no more ... umm the dusty old api ; Wow have you been living under stone or what ? :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!