mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Feat] (MG_State): Add external index getter for each object.
This commit is contained in:
@@ -211,7 +211,7 @@ namespace MobileGL {
|
||||
GLsizei c = std::min((GLsizei)s.size(), maxCount);
|
||||
if (count) *count = c;
|
||||
for (GLsizei i = 0; i < c; ++i) {
|
||||
shaders[i] = s[i]->GetId();
|
||||
shaders[i] = s[i]->GetExternalIndex();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace MobileGL::MG_Impl::GLImpl {
|
||||
if (it != m_proxyTexturesMap.end()) {
|
||||
m_proxyTexturesMap.erase(it);
|
||||
}
|
||||
m_proxyTexturesMap[target] = MakeShared<MG_State::GLState::TextureObject2D>();
|
||||
m_proxyTexturesMap[target] = MakeShared<MG_State::GLState::TextureObject2D>(0);
|
||||
return m_proxyTexturesMap[target];
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ namespace MobileGL {
|
||||
|
||||
// TODO: get real info in EGL
|
||||
auto fbo0 = MG_State::pGLContext->CreateFramebufferObject(0);
|
||||
auto colorTex = MakeShared<MG_State::GLState::TextureObject2D>();
|
||||
auto colorTex = MakeShared<MG_State::GLState::TextureObject2D>(0);
|
||||
colorTex->SetInternalFormat(TextureInternalFormat::RGBA8);
|
||||
colorTex->SetMipmapLevel({{512, 512, 1}, 0, false, 0, {nullptr, 0}});
|
||||
auto depthTex = MakeShared<MG_State::GLState::TextureObject2D>();
|
||||
auto depthTex = MakeShared<MG_State::GLState::TextureObject2D>(0);
|
||||
depthTex->SetInternalFormat(TextureInternalFormat::Depth32FStencil8);
|
||||
depthTex->SetMipmapLevel({{512, 512, 1}, 0, false, 0, {nullptr, 0}});
|
||||
auto stencilTex = MakeShared<MG_State::GLState::TextureObject2D>();
|
||||
auto stencilTex = MakeShared<MG_State::GLState::TextureObject2D>(0);
|
||||
stencilTex->SetInternalFormat(TextureInternalFormat::Depth32FStencil8);
|
||||
stencilTex->SetMipmapLevel({{512, 512, 1}, 0, false, 0, {nullptr, 0}});
|
||||
fbo0->AttachTexture(FramebufferAttachmentType::Color0, colorTex);
|
||||
|
||||
Reference in New Issue
Block a user