DirectX, OpenGL and other libraries are at the core of the engines. You can't explicitly see them because the engine creates an infrastructure that serves as an abstraction of all that for you. For instance, effects like smoke will aggregate some D3DX Buffer for the sprite positions, a D3DX Effect for the rendering, all of that will be used by a Direct3D Device during the rendering...
Currently I'm using a single state shared across multiple Lua scripts. On the C++ side, the 'mod' definition will register all the .lua files necessary for the game objects, these files contains a factory to create an object (table) inside the lua state, so I don't need a class Enemy or Ally on the C++ side, I just need an Entity providing a minimum interface and which invokes the Enemy or Ally factories from Lua.
The Lua objects communicate using message passing, the interaction is coordinated on the C++ side, using uid's. And since the queues are also in Lua I have freedom to send from int's to complex data structures, if necessary.
You can check this more thoroughly by running the sample in the reference rasterizer. If it looks fine there, smells like a driver and/or hardware problem.