osx : fix syscalls

This commit is contained in:
hymei
2022-06-05 01:13:13 +03:00
committed by nillerusr
parent c7308906d1
commit 3291cdf978
16 changed files with 92 additions and 32 deletions
+19 -6
View File
@@ -670,7 +670,7 @@ void GLMContext::DumpCaps( void )
#define dumpfield_hex( fff ) printf( "\n %-30s : 0x%08x", #fff, (int) m_caps.fff )
#define dumpfield_str( fff ) printf( "\n %-30s : %s", #fff, m_caps.fff )
printf("\n-------------------------------- context caps for context %08x", (uint)this);
printf("\n-------------------------------- context caps for context %p", this);
dumpfield( m_fullscreen );
dumpfield( m_accelerated );
@@ -1745,8 +1745,9 @@ void GLMContext::PreloadTex( CGLMTex *tex, bool force )
}
}
gGL->glUseProgram( (GLuint)preloadPair->m_program );
gGL->glUseProgramObjectARB( preloadPair->m_program );
//gGL->glUseProgram( (GLuint)preloadPair->m_program );
m_pBoundPair = preloadPair;
m_bDirtyPrograms = true;
@@ -1793,7 +1794,7 @@ void GLMContext::PreloadTex( CGLMTex *tex, bool force )
gGL->glEnableVertexAttribArray( 0 );
gGL->glVertexAttribPointer( 0, 3, GL_FLOAT, 0, 0, posns );
gGL->glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), posns );
gGL->glDrawRangeElements( GL_TRIANGLES, 0, 2, 3, GL_UNSIGNED_SHORT, indices);
@@ -2701,6 +2702,10 @@ GLMContext::GLMContext( IDirect3DDevice9 *pDevice, GLMDisplayParams *params )
// debug state
m_debugFrameIndex = -1;
#if defined( OSX ) && defined( GLMDEBUG )
memset( m_boundProgram , 0, sizeof( m_boundProgram ) );
#endif
#if GLMDEBUG
// #######################################################################################
@@ -5202,11 +5207,11 @@ void GLMContext::DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize
if ( pIndexBuf->m_bPseudo )
{
// you have to pass actual address, not offset
indicesActual = (void*)( (int)indicesActual + (int)pIndexBuf->m_pPseudoBuf );
indicesActual = (void*)( (intp)indicesActual + (intp)pIndexBuf->m_pPseudoBuf );
}
if (pIndexBuf->m_bUsingPersistentBuffer)
{
indicesActual = (void*)( (int)indicesActual + (int)pIndexBuf->m_nPersistentBufferStartOffset );
indicesActual = (void*)( (intp)indicesActual + (intp)pIndexBuf->m_nPersistentBufferStartOffset );
}
#if GLMDEBUG
@@ -5244,7 +5249,11 @@ void GLMContext::DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize
}
else
{
#if defined( OSX )
// MoeMod: TOGL IS NOT USING m_boundProgram THIS AT ALL
#else
AssertOnce(!"drawing with no vertex program bound");
#endif
}
if (m_boundProgram[kGLMFragmentProgram])
@@ -5253,7 +5262,11 @@ void GLMContext::DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize
}
else
{
#if defined( OSX )
// MoeMod: TOGL IS NOT USING m_boundProgram THIS AT ALL
#else
AssertOnce(!"drawing with no fragment program bound");
#endif
}
#endif