Page 4 of 21 FirstFirst 12345678914 ... LastLast
Results 46 to 60 of 307

Thread: Coder's Hang-out

  1. #46
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Quote Originally Posted by pkt-zer0
    Yeah, namespaces is one of the oddities that were added to C in C++. Supposedly makes your life easier in some cases, when fiddling around inside objects.
    There's no problem with using return 0, but I prefer using system("pause"); instead of getchar. I think you need to include <windows> for that.
    I C. lol, and I've just started copying some code to play around with from a book I loaned from the library.

    This is what I've done so far, just going over the code now studying it

    Download Links:
    Links are hidden from guests. Please register to be able to view these links. EDIT: I think I'd best look over easier stuff for a while longer.

  2. #47
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Hehe, don't mess around with the Windows API until you know you have a lot of time to spare. It doesn't seem that hard, it's just that you need to set a bazillion of variables and handles to create a single window. It still makes pretty much sense, but having to see how a few dozen functions work just to create a window is pretty taxing. That's why I stopped the last time I was looking into how it worked, it's not that I'm gonna use it that much. At least, not right now.

  3. #48
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Quote Originally Posted by pkt-zer0
    Hehe, don't mess around with the Windows API until you know you have a lot of time to spare. It doesn't seem that hard, it's just that you need to set a bazillion of variables and handles to create a single window. It still makes pretty much sense, but having to see how a few dozen functions work just to create a window is pretty taxing. That's why I stopped the last time I was looking into how it worked, it's not that I'm gonna use it that much. At least, not right now.
    Well I'm jumping into the deep end while I have the time lol. I'm just doing a tutorial now for a DirectDraw Encapsulation. LOL, I might be able to do a 3D emuparadise game

  4. #49
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Namespaces are good... Let's say you are working with many header files and you make a render thing that just happens to be teh name of a render function in the API just one that you don't use or see because it's called by anotehr function. In reality, you're adding to that other function and calling the entire function. Namespaces are important.

    And anyone have a winapi tutorial? One that works with visual studio and with lots of comments?

  5. #50
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Quote Originally Posted by kohlrak
    Namespaces are good... Let's say you are working with many header files and you make a render thing that just happens to be teh name of a render function in the API just one that you don't use or see because it's called by anotehr function. In reality, you're adding to that other function and calling the entire function. Namespaces are important.

    And anyone have a winapi tutorial? One that works with visual studio and with lots of comments?
    Hmm, would this be of any help?

    http://www.hal-pc.org/~johnnie2/windows.html
    http://people.montana.com/~bowman/Software/winAPI.htm

    Edit: I'm making a nice bit of progress on this book, I can see why half of this code is actually here (Like for what purpose).
    Last edited by Stark; 25th-September-2005 at 12:26.

  6. #51
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you, now to wait till next weekend to look into it. (basically what i want is that because it supports UNICODE as wchar_t. That way i can actually compair strings and such and make programs that allow multi-language input. ANd because it's much much better looking also.)

    ADDITION: Dude... what the heck is with microsoft and unsigned shorts!? If you make a class, you can have void type functions. Yet when you use it's pointer as a parameter for a function that can only take void types, it comes up with an error... this makes no sence...

    Quote Originally Posted by VISUAL C++ 6.0
    F:\cgi-bin\Cpp1.cpp(69) : error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)'
    None of the functions with this name in scope match the target type
    yea... i hate you too....

    Quote Originally Posted by Function D
    class function {
    public:
    void functiond () {
    std::cout << "test";
    return; } };
    Quote Originally Posted by Thing that caused error
    CreateThread (
    NULL, NULL,
    (LPTHREAD_START_ROUTINE) basic::function::functiond,
    NULL, NULL, 0 /*this->extraid*/);
    Yes... windows.h was included..... Yes everything mentioned here is in the basic namespace i made to organize the things... It makes no sence to me what the error is... but i see it's a bit odd that unsigned long was mentioned... unsigned short, unsigned long... do these things even have a purpose in C++ other than microsoft's little scape goat for not doing their job? Is this an error with just visual studio or all of them?
    Last edited by kohlrak; 29th-September-2005 at 02:08.

  7. #52
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Thought I would post that I've reached 1000 lines of code now

    I'll finish off this DirectDraw Encapsulation ( probably 100 lines code tops ) Then I can start on an introduction to Direct3D

  8. #53
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by TheotheImpaler
    Thought I would post that I've reached 1000 lines of code now

    I'll finish off this DirectDraw Encapsulation ( probably 100 lines code tops ) Then I can start on an introduction to Direct3D
    Good job, you sick bastard. Maybe you should sleep more and code less.

    ...Or maybe I should sleep less and code more. Yikes.

  9. #54
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    Quote Originally Posted by pkt-zer0
    Good job, you sick bastard. Maybe you should sleep more and code less.

    ...Or maybe I should sleep less and code more. Yikes.
    lol, I think I did go a bit insane, but I suppose 3D direct has to be like this

    I just want to be able to code an actual game

  10. #55
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I hate the direct x api... it's a mess... They send you through a load of loops and never give you much of a tutorial to it... More like "look this up and this and this, oh and if you have no clue what this does look here."

  11. #56
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Download Links:
    Links are hidden from guests. Please register to be able to view these links. Could someone identify why the above code screws up in a seemingly random way? I'm sure I've overlooked something totally trivial. It's supposed to write to a file bit-by-bit, instead of byte-by-byte. The bitpos static variable is used to keep track of the bit position, from 0 to 7. The rest are pretty self-explanatory, I think.

    EDIT: Oh sh-... Well, after I stopped thinking real hard about this, I realized I was doing it the most complicated and error-prone way possible. Good job.
    Last edited by pkt-zer0; 3rd-October-2005 at 19:00.

  12. #57
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    bitpose? You mean they have somthing out there that actually supports bit by bit instead of byte(s) by byte(s) other than operators?

  13. #58
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Nope, I was trying to WRITE that code. 'bitpos' was just a static variable that wasn't declared in that piece of code, only outside the main function.
    You could still mess around with bit fields, but if you're trying to do stuff on the bit level other than flags, you'd best use the bitwise operators.

  14. #59
    Join Date
    Aug 2004
    Posts
    6,802
    Thanks
    30
    Thanked 98 Times in 49 Posts
    EP Points
    205

    Default

    lol, I wrote 1357 lines of code and finally finished this DirectDraw Encapsulation, and I get an error at line 10 of the header file lol. Something about not finding <studio.H> so I'll have to look at that, I think it might be the visual studio I'm using though.

    sos I'm not able to help you pkt-zer0 and kohlrak, I'd have to read up on it as I'm still a newbie .

  15. #60
    Join Date
    Feb 2005
    Location
    Limbo
    Posts
    3,706
    Thanks
    0
    Thanked 2 Times in 2 Posts
    EP Points
    10

    Default

    Quote Originally Posted by TheotheImpaler
    lol, I wrote 1357 lines of code and finally finished this DirectDraw Encapsulation, and I get an error at line 10 of the header file lol. Something about not finding <studio.H> so I'll have to look at that, I think it might be the visual studio I'm using though.

    sos I'm not able to help you pkt-zer0 and kohlrak, I'd have to read up on it as I'm still a newbie .
    Wouldn't that be the compiler-specific header that you'd need to copy from the SDK? Don't take my word for it, I've only dabbled in a physics simulation SDK, not DDraw. Lower/uppercase might matter. Or maybe not.

Similar Threads

  1. Visit The Hang Out!
    By Georgyw5k in forum Free 4 All
    Replies: 5
    Last Post: 28th-November-2003, 05:18
  2. Do You Hang Up On Advertisement Callers?
    By ((KvN)) in forum Free 4 All
    Replies: 52
    Last Post: 21st-July-2003, 11:16

Posting Permissions

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

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social