Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 May 2006
Offline Last Active Jun 20 2016 06:04 AM

Posts I've Made

In Topic: Lua with CML

04 June 2016 - 08:15 AM

I got this figured out, I was really close, but missing the signature for a function pointer to member is different than a function pointer to a free function.

.addFunction("__add", (Vector3&(Vector3::*)(const Vector3&))&Vector3::operator+=)

I had * instead of Vector3::* in the middle of the function pointer type.

In Topic: Lua with CML

04 June 2016 - 05:55 AM

That is what I hve been trying but poking around in the dark at the end of a very long day trying to guess the function signature had been less than effective. Even when I use auto, the compiler can't figure it out I guess because there are multiple overrides of the operator+= function. I think that is why .addFunction is complaining and making me explicitly cast to one of them. I've also tried using decltype to determine the signature, but with the same results.

I was also unable to get operator[] to work and I now realize for the same reason. I am able to define a helper struct and delegate to the original object but I'd rather not have to do that especially if it is as trivial as figuring out what the compiler thinks the function signatures are.

I'm using clang with C++14 support if that helps.

In Topic: Interleaved Arrays

17 July 2012 - 08:02 PM

Figured this out. In line 43 of my second code snip, notice anything wrong there? I bind the vertex buffer again, and give it the index data. No wonder nothing was getting rendered, and my vertex buffer was corrupted.

What tipped me off, as I was just about to call it a night, i was staring at the Vertex Buffer Objects node in gDEBugger, and noticed VBO2 said something to the effect of 'not attached'. Not attached? And why is my index data showing up in VBO1 if I'm setting data in the vertex buffer first, I would think the index data would be in VBO2.

Thanks to Neilo and Brother Bob though for pointing out VAOs. They are pretty slick.

In Topic: Horizon SkyDome Sun Shader

30 March 2012 - 08:37 PM

Awhile back I started to come up with a 'close enough' approach to rendering the sun in the sky. http://matt328.wordpress.com/category/xna/ These two posts here try to detail what I've done. It's nowhere near the aforementioned models and pretty incomplete, but if you're just looking for somewhere to start your own implementation, you might find them interesting reads.

In Topic: Sadistic library authors (my rant about Xerces for C++)

26 March 2012 - 06:51 PM

Whats wrong with TinyXml++? Its a few source files you can drop into your project and code written with it is about as concise as parsing xml can be. The few times I've had to parse xml in C++ its worked pretty well for me.

It might not be the fastest thing there is, but the decision to use xml pretty much admits that you favor human readability over performance anyway.

Edit: Doh i see you were looking for something that validates against a schema which I don't think TinyXml++ does. I validation is something that you decide can fall off the cart, check out TinyXml++.