This commit is contained in:
Branimir Karadžić 2015-04-10 19:21:31 -07:00
parent 428e586e11
commit 9aa304f86f
5 changed files with 3 additions and 24 deletions

View file

@ -278,25 +278,6 @@ namespace bgfx
g_callback->fatal(_code, temp); g_callback->fatal(_code, temp);
} }
void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far)
{
const float aa = 2.0f/(_right - _left);
const float bb = 2.0f/(_top - _bottom);
const float cc = 1.0f/(_far - _near);
const float dd = (_left + _right)/(_left - _right);
const float ee = (_top + _bottom)/(_bottom - _top);
const float ff = _near / (_near - _far);
memset(_result, 0, sizeof(float)*16);
_result[0] = aa;
_result[5] = bb;
_result[10] = cc;
_result[12] = dd;
_result[13] = ee;
_result[14] = ff;
_result[15] = 1.0f;
}
#include "charset.h" #include "charset.h"
void charsetFillTexture(const uint8_t* _charset, uint8_t* _rgba, uint32_t _height, uint32_t _pitch, uint32_t _bpp) void charsetFillTexture(const uint8_t* _charset, uint8_t* _rgba, uint32_t _height, uint32_t _pitch, uint32_t _bpp)

View file

@ -816,8 +816,6 @@ namespace bgfx
} }
}; };
void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far);
struct MatrixCache struct MatrixCache
{ {
MatrixCache() MatrixCache()

View file

@ -1171,7 +1171,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
deviceCtx->IASetIndexBuffer(ib.m_ptr, DXGI_FORMAT_R16_UINT, 0); deviceCtx->IASetIndexBuffer(ib.m_ptr, DXGI_FORMAT_R16_UINT, 0);
float proj[16]; float proj[16];
mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
PredefinedUniform& predefined = program.m_predefined[0]; PredefinedUniform& predefined = program.m_predefined[0];
uint8_t flags = predefined.m_type; uint8_t flags = predefined.m_type;

View file

@ -944,7 +944,7 @@ namespace bgfx { namespace d3d9
DX_CHECK(device->SetIndices(ib.m_ptr) ); DX_CHECK(device->SetIndices(ib.m_ptr) );
float proj[16]; float proj[16];
mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
PredefinedUniform& predefined = program.m_predefined[0]; PredefinedUniform& predefined = program.m_predefined[0];
uint8_t flags = predefined.m_type; uint8_t flags = predefined.m_type;

View file

@ -1857,7 +1857,7 @@ namespace bgfx { namespace gl
GL_CHECK(glUniform1i(program.m_sampler[0], 0) ); GL_CHECK(glUniform1i(program.m_sampler[0], 0) );
float proj[16]; float proj[16];
mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f); bx::mtxOrtho(proj, 0.0f, (float)width, (float)height, 0.0f, 0.0f, 1000.0f);
GL_CHECK(glUniformMatrix4fv(program.m_predefined[0].m_loc GL_CHECK(glUniformMatrix4fv(program.m_predefined[0].m_loc
, 1 , 1