Fix for Issue 128

This commit is contained in:
Mikko Mononen 2010-10-10 10:14:52 +00:00
parent 7e69ce1296
commit c701f583da
2 changed files with 6 additions and 3 deletions

View File

@ -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);
} }

View File

@ -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);