Answer the question
In order to leave comments, you need to log in
Are the linear dimensions of the polygon in the emulator increased by 1.5 times?
Debian Sid / SDK 20.0.3 / Emulator + kvm + GPU Emulation
I'm using GLES20. I'm making a sprite class that would save linear dimensions (in pixels) at any screen resolution (and when changing orientation too). Everything is fine, only the linear dimensions are increased by 1.5 times. I can't test it on a real device.
I set the orthogonal projection like this:
float sp = 0.5f;
Matrix.orthoM(mProjMatrix,0 ,-sp, sp, -sp, sp, -sp, sp);
vertexBuffer = createPlane(width/_width/2, height/_height/2);
private FloatBuffer createPlane(float _width, float _height)
{
float quard[] =
{
-_width, _height, 0.0f,
_width, _height, 0.0f,
-_width, -_height, 0.0f,
_width, -_height, 0.0f
};
return floatbufferFactory(quard);
}
private FloatBuffer floatbufferFactory(float[] buffer)
{
ByteBuffer bb = ByteBuffer.allocateDirect(buffer.length*4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer result = bb.asFloatBuffer();
result.put(buffer);
result.position(0);
return result;
}
Answer the question
In order to leave comments, you need to log in
genymotion I advise you to try this emulator, I like it the most ;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question