What i'm trying to achieve. I need to know the equivalent of LPDIRECT3DTEXTURE9
to openGL, the problem is I only know Pixmap
class of libgdx which pixmap.drawPixel(x, y, color)
is only available, I cannot find how to convert layer->lightMap->LockRect(0, &rectLock, 0, 0)
Below is example code of c, LPDIRECT3DTEXTURE9
lightMap is used which unknown in openGL to me.
D3DLOCKED_RECT rectLock;
D3DCOLOR* pixels;
LandLayer* layer;
int j;
for (int i = 0; i < m_layers.GetSize(); i++)
{
layer = m_layers[i];
layer->lightMap->LockRect(0, &rectLock, 0, 0);
pixels = (D3DCOLOR*)rectLock.pBits;
for (j = 0; j < MAP_SIZE * MAP_SIZE; j++)
pixels[j] = D3DCOLOR_ARGB(layer->alphaMap[j], m_colorMap[j * 3], m_colorMap[j * 3 + 1], m_colorMap[j * 3 + 2]);
layer->lightMap->UnlockRect(0);
}
What I have done in kotlin, using Pixmap
from libgx https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/Pixmap.java
tmpColor.set( Color.toIntBits( r.toInt(),g.toInt(),b.toInt(),a.toInt()))
pixmap.drawPixel(x, y, tmpColor.toIntBits())