gowron67

Members
  • Content count

    96
  • Joined

  • Last visited

Community Reputation

152 Neutral

About gowron67

  • Rank
    Member
  1. template question..

    Thanks Zahlman but as I said in my original post, I wasn't asking about the design of the system. I know it's not ideal. It turns out I don't have the option / time to change it, hence my original question. The pseudo-code I gave is also exactly that - the real system is a lot more complex( and doesn't involve dynamic_cast ( that was contrived to get my point across ) ). The simplest solution to the problem I have is the one ToohrVyk and Xai suggested but thanks anyway.
  2. template question..

    Thanks guys....I hadn't thought of doing the intermediate class.... Toorvyk - just out of interest...if dynamic_cast returns NULL for a Derived< 5 > if the pointer is of a Derived< 3 > type for example, what would a C-style cast do in the same situation ? Would it still be safe to use the pointer ?
  3. class Base { ... std::string name; }; template<N> class Derived : public Base { void MyDerivedFunction(); ... float data[ N ]; }; Base* array[ 512 ]; Say I create a few of class Base, and push them into the Base* array... Say then I create a few Derived< 3 >, a few Derived< 10 > etc.. and push them into the Base* array.... Say I then loop through my array //do something with the Derived* objects... for( int i = 0; i < whatever; ++i ) { Derived* ptr = dynamic_cast< Derived* >( array[ i ] ); if( ptr ) { .... } } This code won't compile because I need to specify the type of Derived explicitly i.e. Derived< 3 >*....that's fine - fair enough, but my question is since I don't necessarily know the exact types of some of the Derived* objects in the array, is it safe to use an arbitrary one to call MyDerivedFunction()...like this.. #define ARBITRARY_NUMBER 5 //do something with the Derived* objects... for( int i = 0; i < whatever; ++i ) { Derived<ARBITRARY_NUMBER>* ptr = dynamic_cast< Derived<ARBITRARY_NUMBER>* >( array[ i ] ); if( ptr ) { //do something ptr->MyDerivedFunction(); } } This code works but I'm wondering if it's safe to do this, will 'nasty' things happen somewhere because I'm using a slightly different type i.e. Derived<5> instead of for example Derived<3>. I realise that the code above may well be very badly designed but it's just an illustration of some more complex code I have. I'm not asking if what I'm doing is good design, I'm just asking if it's safe to do this kind of thing.... thanks.
  4. conv3ds

    good man, thank you.
  5. conv3ds

    It's been a while since I used it, but I was looking for conv3ds recently but it doesn't seem to be included with DirectX installs anymore. Does anyone know why this is and where I can get hold of it ? ( yes I have googled but just find many references to it here on gamedev in threads about how to use it, rather than where to find it ). Thanks.
  6. I had this exact problem - saving files in Visual Studio and my PC bluescreening complaining about vsdatant.sys. Vsdatant.sys is a file used by zonelabs for the zonealarm firewall. The only way I could get around this problem was to roll back to a previous version of the firewall. There doesn't seem to be a fix for the file in question on the zonelabs website
  7. A little bit of a toughy...

    He means..... if (shootcounter = 99) { firebullet(); } if (shootcounter = 100) shootcounter = 0; should be.... if (shootcounter == 99) { firebullet(); } if (shootcounter == 100) shootcounter = 0; you were assigning instead of testing for equality. I don't think that's anything to do with your problem though.
  8. Whenever I try to use them, I get internal compiler errors under .NET 2003. The only info about this I could find from googling around ( and search on MSDN ) was that maybe the compiler was running out of heap space when generating the PCH. So I tried the /Zm switch to allocate the maximum possible but I still get 'INTERNAL COMPILER ERROR' all the time. I can't find anyone else who's had this problem... Anyone have any ideas ?
  9. unresolved externals (MSVC6)

    you may have the path to the library set up correctly, but it sounds like you're not trying to link to the jpeg library. Have a look at project properties->linker->command line. You should see libjpeg.lib in there. If it's not you'll need to link to it explicitly - in the linker->input tab, type the library name.
  10. Quote:Original post by Anonymous Poster 2. Pretty hard as there are no standard libraries for things like high performance graphics on most consoles, but rahter a custom job for each. The X-Box being the notable exception as it is similar to PC. 3. No and probably not. 2. It very much depends on what type of code you're talking about. If you're talking about the low level rendering stuff then yes, it is hard( initially ) to port it to different platforms ( ps2, xbox, gc, pc etc ), but for the vast majority of game code ( as opposed to library code ), porting isn't an issue at all as long as you have decent compilers for each platform. 3. hmmm, well the GameCube used an API similar to OpenGL and I've also heard that it's going to be used for the PSP and PS3
  11. I've just got multiple render windows working( in an MFC app ) by creating a swap chain for each one, then in the OnDraw function of each window, setting the render target to the back buffer associated with the swap chain, then doing the usual Clear, BeginScene, EndScene, Present cycle..... My problem is that if I create each swap chain with a back buffer size of more than 500 * 500 pixels, the contents of the buffer when displayed is just seemingly random video memory. Creating each swap chain with a back buffer size of less than or equal to 500 * 500 pixels works fine !. Is there a limit to the size of backbuffers you can create for swap chains ? It doesn't say this anywhere in the documentation and I get no errors returned from IDirect3DSwapChain9::CreateAdditionalSwapChain even when my back buffers are larger than 500*500 pixels. Anyone have any ideas ? Thanks.
  12. It's really no help saying things are 'trivial'. They may be trivial to you but people wouldn't post on here if they could already do what they were asking.
  13. projection matrix

    I understand the model -> world and world -> camera transformation matricies but after those two transforms I want to know how that camera space coordinate actually ends up as a 2D coordinate in the viewport window.... I also am ok with actually calculating a projection matrix... So my problem is.... Am I right in thinking that the projection matrix transforms space from the camera viewing frustum to a cube ? If so, assuming I have a correct projection matrix, I should just be able to transform a 3d vector( point ), by the projection matrix and that would give me the coordinates of the 3d point in the projection cube... So if I then divide the x and y coords of of the transformed point by the w value of the transformed point, that should give me the coordinates of the point in my actual viewport ranging from -1.0f to 1.0f ? Then, if I multiply that number by the viewport width and height, I get the actual windows screen coordinates ? Is all of this correct ? Can anyone tell me where I've gone wrong. All this is with a view to doing some sort mouse clicking on objects in my world, but I'm a bit stuck on the maths needed.