Search:

Type: Posts; User: alanb

Search: Search took 0.00 seconds.

  1. Format for exporting a 3ds Max model to use with DX

    Should I try to have 3ds give me a vertex list so I can use the model with directx or is there a better way?
  2. Replies
    8
    Views
    1,033

    No, I wasn't, and I've moved that line (and...

    No, I wasn't, and I've moved that line (and others like it) to a constructor within the declaration, and I removed the instance names in the process. I can now access the members in that way from...
  3. Replies
    8
    Views
    1,033

    I began by removing it until I could compile...

    I began by removing it until I could compile cleanly, then I took the assignments collecting in the main .cpp and put them back into a constructor and all seems well.
  4. Replies
    8
    Views
    1,033

    void do_something(cPlayer &player); //declaration...

    void do_something(cPlayer &player); //declaration
    :)
  5. Replies
    8
    Views
    1,033

    I tried duplicating the declaration just after it...

    I tried duplicating the declaration just after it and removed the constructor and gave the floats a value. The compiler says - 'cPlayer' : 'class' type redefinition.

    I was paraphrasing, sorry.
    ...
  6. Replies
    8
    Views
    1,033

    Creating class - linker problems

    Should this work?


    /* .h */

    class cPlayer //declaration
    {
    public:
    float x, y, z;
  7. Replies
    12
    Views
    2,164

    Thanks for the by reference suggestions and the...

    Thanks for the by reference suggestions and the info on pointers, this will help me in future.

    I think I'll try a class. The more I think of it, the more it seems appropriate for later expansion.
  8. Replies
    12
    Views
    2,164

    Not sure but would a class seem overkill for...

    Not sure but would a class seem overkill for three floats? Would the point be to fill the class with some of the surrounding code?
  9. Replies
    12
    Views
    2,164

    Having a function return three values

    In one cpp file I have three particular variables and a loop. From within this loop I want to pass the three variables to a function in another cpp file. Before I do this I want to pass them to an...
  10. Replies
    4
    Views
    1,814

    OK, so I gather that global header files should...

    OK, so I gather that global header files should be used judiciously and preferrably only semi-globally.



    Say, I want to build a world. I have one file for starting and getting a window, one for...
  11. Replies
    4
    Views
    1,814

    Trying to make the best use of header files

    Until now I have been putting all function declarations in a single global header file (except for those that have an obviously limited need of scope).

    I am now considering putting all...
  12. Replies
    3
    Views
    834

    The access violation is a reading one. I began...

    The access violation is a reading one. I began looking for an out of range subscript, and found one, also the exception was happening at 3 minutes from run.

    Now it is happening at this line
    ...
  13. Replies
    3
    Views
    834

    Where to start debugging an exception

    I have a d3d program, that if I run it and leave it alone it will render a scene and wait for keyboard input but in a few minutes will come up with an unhandled exception (access violation) calling a...
  14. Aha, I see. It will take a while for me to...

    Aha, I see.

    It will take a while for me to un-learn inline programming. OOP has much potential but right now it just seems like a pain. Thanks for the assist.
  15. Got it! I moved it all into a function but I...

    Got it!

    I moved it all into a function but I had 'undeclared' errors, then I realised that the two declarations needed a wider scope and I put them at the top of the file and the two next lines...
  16. No, I'm doing it directly in the source file...

    No, I'm doing it directly in the source file after some preprocessor stuff.
  17. Compiler thinks I'm defining when I'm trying to call

    I'm trying to create a DX sprite...

    LPD3DXSPRITE d3dspt;
    LPDIRECT3DTEXTURE9 sprite;

    D3DXCreateSprite(d3ddev, &d3dspt);
    D3DXCreateTextureFromFile(d3ddev, L"panel1.png", &sprite);
    ...and I'm...
  18. Replies
    19
    Views
    2,405

    That's what I thought? I figured since this...

    That's what I thought?

    I figured since this question was not C++ specific.....I'll get the hang of it.
  19. Replies
    19
    Views
    2,405

    I have it working now I put the extern line in...

    I have it working now I put the extern line in the header and the second line in only one source file. Thanks :)

    These structs come from a library. When the compiler was suggesting I was defining...
  20. Replies
    19
    Views
    2,405

    I made it, extern lpStruct var; lpStruct var;...

    I made it,

    extern lpStruct var;
    lpStruct var;

    and included this in both source files. It gives: already defined in the second file. If I comment out the second line it gives 'unresolved...
  21. Replies
    19
    Views
    2,405

    I find that if I don't include the header file...

    I find that if I don't include the header file with the declarations into both source files (but just one), I get undeclared identifier errors. If I do, I get linker errors.

    These declarations are...
  22. Replies
    19
    Views
    2,405

    OK, I have some global variables (structs) that I...

    OK, I have some global variables (structs) that I want to share across two source files and I've moved their declarations to the header of one of these files instead of the main header.

    I've...
  23. Replies
    19
    Views
    2,405

    I can hardly believe it sounds so simple (wait,...

    I can hardly believe it sounds so simple (wait, haven't tried it yet). Should every source file have its own header?

    Would it also be OK to declare the functions in the header file corresponding...
  24. Replies
    19
    Views
    2,405

    Connecting and dealing with source files

    I'm after a primer on how to deal with files. I want to learn things like: connecting .h with .c, how to call functions across different .c files, when/how often to include a file, whether a function...
Results 1 to 24 of 25