Skip to main content

Home/ game programming/ Group items tagged c

Rss Feed Group items tagged

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

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.
jdr santos

Box2D - Home - 0 views

  •  
    Box2D is a 2D rigid body simulation library for games. Programmers can use it in their games to make objects move in believable ways and make the game world more interactive. From the game's point of view a physics engine is just a system for procedural animation. Box2D is written in portable C++. Most of the types defined in the engine begin with the b2 prefix. Hopefully this is sufficient to avoid name clashing with your game engine.
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 - 6 of 6
Showing 20 items per page