Example #1
0
	static int l_grid(lua_State *l) {
		UI::Context *c = LuaObject<UI::Context>::CheckFromLua(1);

		UI::CellSpec rowSpec(0), colSpec(0);

		if (lua_istable(l, 2))
			rowSpec = UI::CellSpec::FromLuaTable(l, 2);
		else
			rowSpec = UI::CellSpec(luaL_checkinteger(l, 2));

		if (lua_istable(l, 3))
			colSpec = UI::CellSpec::FromLuaTable(l, 3);
		else
			colSpec = UI::CellSpec(luaL_checkinteger(l, 3));

		LuaObject<UI::Grid>::PushToLua(c->Grid(rowSpec, colSpec));
		return 1;
	}
Example #2
0
void MCMesh::cb_initGL()
{
	Geom::Vec4f colClear(0.2f, 0.2f, 0.2f, 0.1f);
	Geom::Vec4f colDif(0.8f, 0.9f, 0.7f, 1.0f);
	Geom::Vec4f colSpec(0.9f, 0.9f, 0.9f, 1.0f);

	m_render = new Algo::Render::GL2::MapRender();

	m_positionVBO = new Utils::VBO();
	m_flatShader = new Utils::ShaderFlat();
	m_flatShader->setAttributePosition(m_positionVBO);
	m_flatShader->setAmbiant(colClear);
	m_flatShader->setDiffuse(colDif);
	m_flatShader->setExplode(1.0f);

	//m_simpleColorShader = new Utils::ShaderSimpleColor();
	//m_simpleColorShader->setAttributePosition(m_positionVBO);

	m_linesShader = new Utils::ShaderBoldLines();
	m_linesShader->setAttributePosition(m_positionVBO);

	registerShader(m_flatShader);
//	registerShader(m_simpleColorShader);
	registerShader(m_linesShader);

	m_dr = new Utils::Drawer();
	m_dr->newList();
	m_dr->pointSize(4.0f);
	m_dr->lineWidth(25.0f);
	m_dr->begin(GL_LINES);
	m_dr->color3f(1.0,0.0,0.0);
	m_dr->vertex3f(15.0,15.0,65.0);
	m_dr->vertex3f(110.0,110.0,65.0);
	m_dr->color3f(0.0,1.0,0.0);
	m_dr->vertex3f(110.0,15.0,75.0);
	m_dr->vertex3f(15.0,110.0,75.0);
	m_dr->end();
	m_dr->endList();

}
Example #3
0
void MCMesh::cb_initGL()
{
	Geom::Vec4f colClear(0.2f, 0.2f, 0.2f, 0.1f);
	Geom::Vec4f colDif(0.8f, 0.9f, 0.7f, 1.0f);
	Geom::Vec4f colSpec(0.9f, 0.9f, 0.9f, 1.0f);

	Utils::GLSLShader::setCurrentOGLVersion(2);

	m_render = new Algo::Render::GL2::MapRender();

	m_positionVBO = new Utils::VBO();
	m_flatShader = new Utils::ShaderFlat();
	m_flatShader->setAttributePosition(m_positionVBO);
	m_flatShader->setAmbiant(colClear);
	m_flatShader->setDiffuse(colDif);
	m_flatShader->setExplode(1.0f);

	m_simpleColorShader = new Utils::ShaderSimpleColor();
	m_simpleColorShader->setAttributePosition(m_positionVBO);

	registerShader(m_flatShader);
	registerShader(m_simpleColorShader);
}