• Content count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About Makubab

  • Rank
  1. Wow, I completely overlooked that fact. Makes a lot of sense, not sure what I was thinking. Thanks for pointing that out!
  2. Hello, I came across an issue with multiple inheritance and polymorphism and isolated it down to the following code: [CODE] class class0 { public: virtual void test0(void); }; class Class1 { public: virtual void test1(void); virtual void test2(void); }; class Class2 : public Class1, public class0 { public: virtual void test1(void); virtual void test2(void); virtual void test0(void); }; void Class2::test0(void) { } void class0::test0(void) { } void Class1::test1(void) { } void Class1::test2(void) { } void Class2::test1(void) { } void Class2::test2(void) { } int main(void) { Class1* c1 = new Class2[10]; // Works ((Class2*)c1)[1].test1(); ((Class2*)c1)[1].test2(); // Does not work. c1[1].test1(); c1[1].test2(); delete[] c1; } [/CODE] Now, it seems to me that under polymorphism, both those cases should work. When I investigate c1's virtual function table, it changes at each index. Various testing has shown me the virtual function table ranges from being just plain wrong to not showing up per item correctly. For example it will show only Class1's table for c1[0], and only class0's table for c1[1]. The code that does not work will crash due to an Access Violation. This is with Visual Studio 2010, default compiler. Maybe I am doing something wrong, this just looks like a bug though. It seems to effectively kill the ability to do polymorphism with multiple inheritance. Any explanation on what's happening here or if I am missing something important would be appreciated. Thanks!
  3. Shader Model 5.0 - Doubles

    Thank you very much for the information. It's working great, such a small thing. I already foresaw issues with moving doubles into the shader, but never came across those two functions, they will help. Thanks again.
  4. Hello, I am working on some shaders in DirectX 11, Shader Model 5.0 and am messing around with double precision. However, it does not seem to be doing anything. I have verified that my video card supports double precision shaders, both in code and through the Caps Viewer. But all my doubles seem to function as floats all the same. Below is the code I am using to test: [code] double var1 = 0.333333333; float var2 = 0.33333333; if(var1 == var2) { //I set the output color to be magenta. } [/code] This happens in the pixel shader, and as stated, I set the output color to be magenta as opposed to another color. The output is always magenta. Unfortunately I cannot find any documentation or examples pertaining to double precision with shaders. I've even tried converting var2 to a double to ensure var1 is not being truncated to a float. Any help would be greatly appreciated, Thank you.
  5. LPDIRECT3DSURFACE9 Initialization With a Class

    Just putting it out there, but maybe you forgot to initialize the class? You don't offer all the code but it often is a easily overlooked mistake especially if all you did was port the code into a class base system.