mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-21 06:13:07 +01:00
Refactored uniform types.
This commit is contained in:
@@ -198,10 +198,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
|
||||
|
||||
// Create texture sampler uniforms.
|
||||
bgfx::UniformHandle u_texCube = bgfx::createUniform("u_texCube", bgfx::UniformType::Uniform1iv);
|
||||
bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
|
||||
bgfx::UniformHandle s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1);
|
||||
bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
|
||||
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
|
||||
|
||||
bgfx::ProgramHandle program = loadProgram("vs_update", "fs_update");
|
||||
bgfx::ProgramHandle programCmp = loadProgram("vs_update", "fs_update_cmp");
|
||||
@@ -356,7 +356,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::setIndexBuffer(ibh);
|
||||
|
||||
// Bind texture.
|
||||
bgfx::setTexture(0, u_texCube, textureCube);
|
||||
bgfx::setTexture(0, s_texCube, textureCube);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_DEFAULT);
|
||||
@@ -385,7 +385,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::setIndexBuffer(ibh);
|
||||
|
||||
// Bind texture.
|
||||
bgfx::setTexture(0, u_texColor, texture2d);
|
||||
bgfx::setTexture(0, s_texColor, texture2d);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_DEFAULT);
|
||||
@@ -410,7 +410,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::setIndexBuffer(ibh, 0, 6);
|
||||
|
||||
// Bind texture.
|
||||
bgfx::setTexture(0, u_texColor, textures[ii]);
|
||||
bgfx::setTexture(0, s_texColor, textures[ii]);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_DEFAULT);
|
||||
@@ -434,7 +434,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::setIndexBuffer(ibh, 0, 6);
|
||||
|
||||
// Bind texture.
|
||||
bgfx::setTexture(0, u_texColor, textures3d[ii]);
|
||||
bgfx::setTexture(0, s_texColor, textures3d[ii]);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_DEFAULT);
|
||||
@@ -458,7 +458,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::setIndexBuffer(ibh, 0, 6);
|
||||
|
||||
// Bind texture.
|
||||
bgfx::setTexture(0, u_texColor, textures[ii]);
|
||||
bgfx::setTexture(0, s_texColor, textures[ii]);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_DEFAULT);
|
||||
@@ -501,8 +501,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::destroyProgram(programCmp);
|
||||
bgfx::destroyProgram(program);
|
||||
bgfx::destroyUniform(u_time);
|
||||
bgfx::destroyUniform(u_texColor);
|
||||
bgfx::destroyUniform(u_texCube);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texCube);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
||||
Reference in New Issue
Block a user