Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

181 Neutral

About raptorstrike

  • Rank
    Advanced Member
  1. In my attempt to develop a generic contracting syntax for C++ I have created some HEAVILY templateted classes. Just when everything seemed in order VS throws up the following error upon compilation c:\c++\contracts\contract.h(185) : error C2664: 'Operator<A,TYPE_A,Op,B,TYPE_B>::Evaluate' : cannot convert parameter 1 from 'int *' to 'int *' with [ A=int *, TYPE_A=Pointer, Op=NE, B=int, TYPE_B=Solid ] This doesn't really seem like something that can be solved but I'm open for any input. XP SP 2 VS 2008 Pro. Thanks for your time =) [Edited by - raptorstrike on December 13, 2008 2:02:28 AM]
  2. hmmm well make sure that the namespace file doesn't include any of the files including it (cyclical inclusion). Here is a minimal example which compiles just fine working on the same principal main.cpp #include <iostream> #include "bar.h" #include "global_namespace.h" //yes I know its there twice #include "global_namespace.h" using namespace std; int main() { bar test; Foo::_cy = 40; Foo::_cz = 20; cout << Foo::_cx << endl; cout << Foo::_cy << endl; cout << Foo::_cz << endl; system("pause"); } global_namespace.h #ifndef NAMESPACE_FOO #define NAMESPACE_FOO namespace Foo { float _cx = 0; float _cy = 1; float _cz = 100; } #endif bar.h #include "global_namespace.h" class bar { public: bar() { Foo::_cx = 100;} };
  3. you need to access these variables through the namespace so if your namespace is sharevariables you should access _cx as sharevariables::_cx making sure of course that you include the namespace header. Hope that helps [smile]
  4. raptorstrike

    Help with random texture mapping

    Based on what you have posted you have the following (I added the brackets) glPushMatrix(); { glEnable(GL_TEXTURE_2D); textureplanet(); glTranslatef(0,0,zax); glutSolidSphere(3,20,20); } glPushMatrix(); //should be POP This is likely the cause of your problem. [smile] EDIT: Welcome to the Forums by the way
  5. raptorstrike

    Maximum speed, but ignoring gravity

    Assuming you have acceleration as a vector quantity on way to cap the acceleration, if your vector's magnitude was greater than the maximum allowed, would be to normalize the vector and scale it by some max value M. Gravity could then be added in later on so that it would not be effected by the cap. Hope I was able to help (and understood the question correctly) [smile] EDIT: If the acceleration was on a per axis basis you could either cap the acceleration in a certain direction (no cap on the -Y direction) or could still use the magnitude method by converting these values to a vector
  6. yes I agree that any such optimization on the operator level has generally been spotted and taken care of either during the compilation process or because of the way the internal representation is set up so no I was not really expecting to gain much from this particular change it was more of a curiosity. Thank you though to all who responded you have been most helpful.
  7. well thats a heck of a way to answer a question (with another question, thank you all the same [smile]) but I see what your saying, the not operator ruins that trade off but with the similar case posted below (a ^ b) or a != b the question is still valid.
  8. My dilemma is with the inner loop of an iterative function which must be as fast as possible, limited by my knowledge of assembly I have resolved to do what I can with the bitwise operators. The basic question is: Is (!(a ^ b)) Faster than (a == b) the result is the same for integers (with the limited tests I have ran so far). The difference is small no doubt but, at this point out of curiosity, I want to find out which offers the greatest speed. Thanks for your time [smile] Edit: Like wise for (a ^ b) and (a != b) [Edited by - raptorstrike on November 13, 2007 10:19:05 PM]
  9. raptorstrike

    Question about flip values every other time

    Yeah what your after is a boolean variable and the easiest way to make it flip flop is to assign it to what it is not so bool X = true; X = !X; // X = false X = !X; // X = true ect... hope that helps
  10. raptorstrike

    Problem with LuaPlus 5

    last try
  11. recently I have taken up perl and as a project for myself I have decided to write a script that translates XML files into C++ class files (I find myself writing XML file loaders way too often) The script is progressing fairly well (it successfully generates a header file for the class) but before I move onto the source code of loading each item I wanted to ask how nested items in the XML file should be handled. Right now the nested node is simply listed as a nested class but I was wondering weather I should instead create a separate header header file and just give the class an appropriate member variable to represent the nested object. EX: class A { public: A(){}; class B { public: B(){}; }; }; as opposed to #include <B.h> class A { public: A(){}; std::vector< B > v_B; }; NOTE that the vector is there because child nodes do not have any name in XML so they would all be put anonymously in a vector for later use. thanks for your time [smile]
  12. raptorstrike

    Problem with LuaPlus 5

    Bump, anyone?
  13. raptorstrike

    Problem with LuaPlus 5

    Recently Ive decided to switch from whatever old version I was using to LuaPlus 5, but, after setting up the library (hopefully correctly), when I went to run the program I got the following error LDR: LdrpWalkImportDescriptor() failed to probe c:\projects\dlls\LuaPlus_1100.dll for its manifest, ntstatus 0xc0150002 Debugger:: An unhandled non-continuable exception was thrown during process load So Im not quite sure how to continue, I looked up similar errors with less than helpful results so I finally decided to come here. If anyone knows what might resolve this error or even what would be causing it (the dll is in the correct directory, same as exe) any input would be appreciated. NOTE: I am using the simple release version of LuaPlus with '05 Express (not the managed or debug versions). [smile]
  14. Well recently I've made the switch to VC++ '05 Express because it tends to have better debugging and exception generating capabilities than Dev-Cpp and I needed something a little more powerful for my current project. Everything goes well with the transition except one thing, when the compiler parses the gl.h file in the Platform SDK it generates hundreds of errors all referencing keywords which should have been previously but apparently were not, here is a quick example c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1172) : error C2144: syntax error : 'void' should be preceded by ';' c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1172) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1172) : error C2086: 'int WINGDIAPI' : redefinition c:\program files\microsoft platform sdk for windows server 2003 r2\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI' those errors point to this line WINGDIAPI void APIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); Considering how widely used these files are I figure that it must be something that I am doing wrong so if anyone has run into a similar problem and knows whats going on I would appreciate any help NOTE: I am including the Windows header before the gl header Microsoft Visual C++ 2005 C++/Open GL Windows XP thanks for your time [smile]
  15. raptorstrike

    How can initialize this?

    If you have an array of type OBJECT as a member than OBJECT MUST have a constructor that takes no parameters so that initialization can be done before entering the body of the constructor. Once in the constructor you are free to change those objects any way you like but the objects have to be initialized using a bland, no parameters, constructor. One way to get around this would be to use an array of pointers and to dynamically allocate all of the objects from within a constructor body using any available OBJECT constructor but then you have to remember to clean up after the array. Hope this helped [smile]
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!