Skip to main content

Home/ game programming/ Contents contributed and discussions participated by metacipher

Contents contributed and discussions participated by metacipher

metacipher

Cone3D Programming - SDL, OpenGL and C++ Tutorials - 0 views

  • screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
    • metacipher
       
      You should note that this tutorial fails to free the memory it created. You should call SDL_FreeSurface(screen) when quitting, to free the display surface created.
metacipher

Cone3D Programming - SDL, OpenGL and C++ Tutorials - 0 views

    • metacipher
       
      These tutorials are really old, but they still hold some good information. I don't recommened using Dev-C for development, but rather using CodeBlocks (google it). You should also note that some of the techniques used within these tutorials are bad.
metacipher

GameDev.net - An Introduction to Lua - 1 views

    • metacipher
       
      This is seemingly out of date (4.0 perhaps). But, a lot of the logic will still work. There is no example in this article for calling a Lua function. You can do it simply by: lua_getglobal(Lua_Handle, "myfunction"); if(lua_pcall(Lua_Handle, 0, 1, 0) != 0) { printf("Error running function: %s\n", lua_tostring(Lua_Handle, -1)); } int Return = (int)lua_tointeger(Lua_Handle, -1); lua_pop(Lua_Handle, 1); Take note though that your script must FIRST be loaded into the vm.
  • lua_baselibopen(luaVM); lua_iolibopen(luaVM); lua_strlibopen(luaVM); lua_mathlibopen(luaVM);
    • metacipher
       
      This seemingly won't work in version 5.1, not sure why. Try using this instead: luaL_openlibs(luaVM);
    • metacipher
       
      Lua seemingly keeps all scripts loaded in the same VM. That is, if you have script1.lua and script2.lua loaded, they will share the same global table. So if you declate a = 1 in script1.lua, script2.lua can see it.
1 - 3 of 3
Showing 20 items per page