Jump to content

  • Log In with Google      Sign In   
  • Create Account


Gambini

Member Since 11 Apr 2012
Offline Last Active Mar 05 2014 06:42 PM

Posts I've Made

In Topic: Arrgh openGL!

11 May 2013 - 09:24 AM

You should have a directory with all of your .lib files in it. Then, in the project properties (make sure you do this for Release and Debug), put that directory in to Linker->General->Additional Library Directories. The directory you give should be relative to the .vcproj file (or absolute), or another option is to use the built-in VS macros to define it relative to your solution directory by doing something like "$(SolutionDir)../lib;". Then head over to Linker->Input->Additional Dependencies and list your .lib files spearated by semicolons (or one per line if you use the drop-down menu and hit the <Edit...> option) . Make sure to hit "Apply" at the bottom right instead of just pressing "Ok". Example for the Additional dependencies, part of mine looks like "glew32.lib;opengl32.lib;glu32.lib;"

 

 

opengl32.lib should be provided by the system, so you don't have to give a specific directory for that, you should just be able to add it to the Additional Dependencies.


In Topic: problem binding a c++ function with luabind

05 May 2013 - 10:24 AM

It looks like out_value doesn't work well with MSVC (here).

 

You'll have to either re-think the function or use Lua's "string.upper" function.

 

Another option is to make your own string class with UCase as a member function. That would bind perfectly fine to Lua, since UCase wouldn't need to take any parameters and only modify the object data.


In Topic: problem binding a c++ function with luabind

04 May 2013 - 04:33 PM

http://www.rasterbar.com/products/luabind/docs.html#out-value

 

That explains how your C++ functions can't take non-const ref/pointers if you want to bind them to Lua. So, the out_value function policy will add a return value in Lua code, rather than modifying the input.

Where your C++ code would look like

char* str = "hi";
UCase(str);
std::cout << str; //prints 'HI'

Your Lua code would look like

local str = "hi"
local ucstr = UCase(str)
--// or you can have str = UCase(str)
print(ucstr) //prints 'HI'

In Topic: Porting from Visual C++ 6.0 to Visual Studio Tricks and Tips?

02 May 2013 - 12:41 PM

To narrow down your errors, you could try some static code analysis tools. If you have a fat wallet, I've heard some decent things about PVS Studio. If you are on more of a budget, then VS2012 (not sure about express) has some integrated static analysis, and there's a few other options if you search around the Internet.


In Topic: Keeping a function on the stack in Lua

09 April 2013 - 04:02 PM

luaL_ref is what you are looking for. As long as you don't destroy/close the lua_State that the ref was made in, the function will exist until you call luaL_unref. lua_ref is a macro that will make the ref in the global registry if you don't want to specify a table yourself.


PARTNERS