first try of osx fix, mostly by pauldachz

This commit is contained in:
degasus
2013-02-07 10:34:29 +01:00
parent dae1226e1b
commit 376a807dea
8 changed files with 8 additions and 150 deletions

View File

@ -56,8 +56,6 @@ void InitInterface()
{
#if defined(USE_EGL) && USE_EGL
GLInterface = new cInterfaceEGL;
#elif defined(USE_WX) && USE_WX
GLInterface = new cInterfaceWX;
#elif defined(__APPLE__)
GLInterface = new cInterfaceAGL;
#elif defined(_WIN32)

View File

@ -334,9 +334,6 @@ Renderer::Renderer()
// Handle VSync on/off
#ifdef __APPLE__
int swapInterval = g_ActiveConfig.bVSync ? 1 : 0;
#if defined USE_WX && USE_WX
NSOpenGLContext *ctx = GLWin.glCtxt->GetWXGLContext();
#else
NSOpenGLContext *ctx = GLWin.cocoaCtx;
#endif
[ctx setValues: &swapInterval forParameter: NSOpenGLCPSwapInterval];

View File

@ -137,7 +137,8 @@ size_t StreamBuffer::Upload ( u8* data, size_t size )
break;
case PINNED_MEMORY:
case MAP_AND_RISK:
memcpy(pointer+m_iterator, data, size);
if(pointer)
memcpy(pointer+m_iterator, data, size);
break;
case BUFFERSUBDATA:
glBufferSubData(m_buffertype, m_iterator, size, data);
@ -187,6 +188,8 @@ void StreamBuffer::Init()
glBufferData(m_buffertype, m_size, NULL, GL_STREAM_DRAW);
pointer = (u8*)glMapBuffer(m_buffertype, GL_WRITE_ONLY);
glUnmapBuffer(m_buffertype);
if(!pointer)
ERROR_LOG(VIDEO, "buffer allocation failed");
case STREAM_DETECT:
break;