Fix for Issue 128
This commit is contained in:
parent
7e69ce1296
commit
c701f583da
@ -22,6 +22,9 @@
|
|||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#include "SDL_opengl.h"
|
#include "SDL_opengl.h"
|
||||||
|
|
||||||
|
// Some math headers don't have PI defined.
|
||||||
|
static const float PI = 3.14159265f;
|
||||||
|
|
||||||
void imguifree(void* ptr, void* userptr);
|
void imguifree(void* ptr, void* userptr);
|
||||||
void* imguimalloc(size_t size, void* userptr);
|
void* imguimalloc(size_t size, void* userptr);
|
||||||
|
|
||||||
@ -235,7 +238,7 @@ bool imguiRenderGLInit(const char* fontpath)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < CIRCLE_VERTS; ++i)
|
for (int i = 0; i < CIRCLE_VERTS; ++i)
|
||||||
{
|
{
|
||||||
float a = (float)i/(float)CIRCLE_VERTS * (float)M_PI*2;
|
float a = (float)i/(float)CIRCLE_VERTS * PI*2;
|
||||||
g_circleVerts[i*2+0] = cosf(a);
|
g_circleVerts[i*2+0] = cosf(a);
|
||||||
g_circleVerts[i*2+1] = sinf(a);
|
g_circleVerts[i*2+1] = sinf(a);
|
||||||
}
|
}
|
||||||
|
@ -894,7 +894,7 @@ int main(int /*argc*/, char** /*argv*/)
|
|||||||
const float r = 25.0f;
|
const float r = 25.0f;
|
||||||
for (int i = 0; i < 20; ++i)
|
for (int i = 0; i < 20; ++i)
|
||||||
{
|
{
|
||||||
const float a = (float)i / 20.0f * (float)M_PI*2;
|
const float a = (float)i / 20.0f * RC_PI*2;
|
||||||
const float fx = (float)x + cosf(a)*r;
|
const float fx = (float)x + cosf(a)*r;
|
||||||
const float fy = (float)y + sinf(a)*r;
|
const float fy = (float)y + sinf(a)*r;
|
||||||
glVertex2f(fx,fy);
|
glVertex2f(fx,fy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user