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

Thread: Coder's Hang-out

Hybrid View

  1. #1
    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

  2. #2
    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.

  3. #3
    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 .

  4. #4
    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.

  5. #5
    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
    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.
    I reckon it's the compiler in the end, maybe I should find something better suited to DirectX programs. I'm compiling it with Visual Studio 2005 Beta 2.

    Well, I'm going to give that a rest for the time being, and play around with Java a bit more, it seems I'm going to need it.
    Last edited by Stark; 3rd-October-2005 at 23:57.

  6. #6
    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. In case anyone was wondering, this is how I did bitwise file manipulation it in the end. A lot more clear, I think. You need to flush the buffer to the file before you close it, but that's pretty easy so I omitted that short code. The only thing I'm wondering is how to stop the excess bits from being read, in an elegant way. (That would be the other half of the problem, bitwise reading, what I'm talking about now)

  7. #7
    Join Date
    Nov 2003
    Location
    USA
    Posts
    4,104
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you don't define test than it would never equal 2, so it's an infinte loop. Why not just have like while(1=1) or something?

    I don't know c++ so I can't really help, but...what was the math problem?

    Some linear combination of two numbers or something it looks.

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

    Default

    i keep screwing up when i type it... the main issue is... Woah... i just tried to do it again and it worked... weird... problem is the original source code put it in a loop which tested the values incrementing and decrementing values which would eventually make values that would match but it refused to exit the loop when the values matched which would have made the condition return false instead of true (because it was a!=b).

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

    Default

    Hmm, I think I figured out what my problem was (with some help from a helpful friend on MSN )

    Example of Hello world program I was using

    #include <iostream.h>

    int main ()
    {
    cout << "Hello World!";
    return 0;
    }

    Correct one I was told to use

    #include <iostream>
    using namespace std;
    void main()
    {
    cout<<"Hello World\n";
    getchar();
    }

    Also making it a Console application as opposed to a Win32 Project helped

    Edit: bit ashamed of this after the level of skill I got for Java.

  10. #10
    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?

  11. #11
    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.

  12. #12
    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.

  13. #13
    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

  14. #14
    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.

  15. #15
    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."

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