Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 12th, 2008, 1:00 PM   #11
KuraKai
Newbie
 
Join Date: Mar 2008
Posts: 25
Rep Power: 0 KuraKai is on a distinguished road
Re: Console Game Development

I can't find anything in it that I am looking for, having issues reading the documentation
KuraKai is offline   Reply With Quote
Old Mar 12th, 2008, 6:03 PM   #12
KuraKai
Newbie
 
Join Date: Mar 2008
Posts: 25
Rep Power: 0 KuraKai is on a distinguished road
Re: Console Game Development

Ok, scratch that post I was able to get through the documentation just took a bit. I not have decent lines going. But now I have to figure out how to use putwin() and getwin(). This is going to be a stupid question but what is a FILE *? How do I create one and such, I know it's a pointer to a file but is it the stream or something or just the location of the file?
KuraKai is offline   Reply With Quote
Old Mar 12th, 2008, 6:08 PM   #13
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
Re: Console Game Development

FILE is whats known as an opaque data type. Its actually a struct, but we don't really care whats in it. How files work below the C library level is OS dependent.

Using C, you can create a file using the fopen function.
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Mar 12th, 2008, 6:51 PM   #14
KuraKai
Newbie
 
Join Date: Mar 2008
Posts: 25
Rep Power: 0 KuraKai is on a distinguished road
Re: Console Game Development

Ok, no that that works I am having issues tying to use color_set(), what the hell is a void *? I start the color and try to change it to COLOR_BLUE and it does not change the color at all, anyone know how to get it to work?
KuraKai is offline   Reply With Quote
Old Mar 12th, 2008, 6:58 PM   #15
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
Re: Console Game Development

void * is a pointer to anything. It needs to be casted to a datatype to be of any use. Notice that malloc() return void *, this is because all malloc does is allocate bytes, how those bytes are interpreted depends on the data type.
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Mar 12th, 2008, 7:57 PM   #16
KuraKai
Newbie
 
Join Date: Mar 2008
Posts: 25
Rep Power: 0 KuraKai is on a distinguished road
Re: Console Game Development

Well I passed it anything and it still has yet to make anything blue.
C++ Syntax (Toggle Plain Text)
  1. #include "curses.h"
  2.  
  3. void main()
  4. {
  5. WINDOW * win = initscr();
  6. start_color();
  7. resize_term(25, 80);
  8. curs_set(2);
  9. noecho();
  10.  
  11. color_set(COLOR_BLUE, win);
  12. wborder(win, 0, 0, 0, 0, 0, 0, 0, 0);
  13. }

Also here is the code for color_set...
C++ Syntax (Toggle Plain Text)
  1. int wcolor_set(WINDOW *win, short color_pair, void *opts)
  2. {
  3. PDC_LOG(("wcolor_set() - called\n"));
  4.  
  5. if (!win)
  6. return ERR;
  7.  
  8. win->_attrs = (win->_attrs & ~A_COLOR) | COLOR_PAIR(color_pair);
  9.  
  10. return OK;
  11. }
  12.  
  13. int color_set(short color_pair, void *opts)
  14. {
  15. PDC_LOG(("color_set() - called\n"));
  16.  
  17. return wcolor_set(stdscr, color_pair, opts);
  18. }
KuraKai is offline   Reply With Quote
Old Mar 12th, 2008, 8:20 PM   #17
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 548
Rep Power: 4 Benoit is on a distinguished road
Re: Console Game Development

According to the color_set manual page,

Quote:
The routine color_set sets the current color of the given window to the foreground/background combination described by the color_pair_number. The parameter opts is reserved for future use, applications must supply a null pointer.
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4
Benoit is offline   Reply With Quote
Old Mar 12th, 2008, 8:43 PM   #18
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 499
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: Console Game Development

KuraKal: After reading your posts in this thread my impression is that you haven't the slightest notion of what the hell you are doing. You have absolutly zero training in either C or C++ so what the hell are you doing trying to write this program? Stop right now and buy an Intruduction to C language book at your local book store or online at amazon.com. Then begin reading and studying form page 1. You are just wasting your and everyone's time posting these questions that any 1st semester student should have learned. This is not the place to teach you c language -- that's what books are written for and the thousands of online tutorials attempt to do.
__________________
I Like Ike. Vote for Dwight Eisenhower this November.
--This message brought to you by the the Procrastinators Club Of America.
Ancient Dragon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Game Development King C++ 26 Mar 10th, 2007 8:44 PM
Video Game Console Course lostcauz Coder's Corner Lounge 9 Sep 29th, 2006 11:09 AM
The Black Art of Video Game Console Design lostcauz Book Reviews 0 Apr 26th, 2006 7:31 PM
Qesution: Program for casual game development kazbadan Other Programming Languages 20 Sep 28th, 2005 1:04 PM
Game Development question n3o_X Coder's Corner Lounge 0 Aug 5th, 2005 11:57 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC