06-08-2009, 05:44 PM
LuisR14
06-09-2009, 02:50 AM
woops left something in "comments"
(but why not just use my version (in my previous post))
(but why not just use my version (in my previous post))Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
char pixels [3];
int x, y;
for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
glReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
glReadPixels( x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
glReadPixels( x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
if( (pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) )
return false;
}
}
return true;
}
void Renderer::SwapBuffers()
{
// [ fix for Fragile by kamui_kun ...
bool pass = false;
if( Renderer::IsBlack() )
pass = true;
// ...]
...
if( !pass )
OpenGL_SwapBuffers();
...
}06-09-2009, 03:15 AM
I haven't Fragile but for other game emu is 100% on my CPU and the screen is blak.
06-10-2009, 11:02 AM
Yeah as i said it causes the rendering to stay black.
LuisR14
06-10-2009, 12:29 PM
hmm strange
, i'm gonna have to look more into it later 
, i'm gonna have to look more into it later 
06-10-2009, 02:37 PM
This is what causes it
for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
LuisR14
06-10-2009, 03:10 PM
that shouldn't be causing it, since it's doing it correctly 

06-10-2009, 04:26 PM
lReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]); << it doesn't like it
LuisR14
06-10-2009, 04:45 PM
hmmm, might you try this 

Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
char pixels [3] = {'', '', ''};
int x, y;
for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
glReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
glReadPixels( x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
glReadPixels( x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
if( (pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) )
return false;
}
}
return true;
}
void Renderer::SwapBuffers()
{
// [ fix for Fragile by kamui_kun ...
bool pass = false;
if( Renderer::IsBlack() )
pass = true;
// ...]
...
if( !pass )
OpenGL_SwapBuffers();
...
}06-10-2009, 06:19 PM
Nooooooo
glReadPixels seems to have a problem with large areas
glReadPixels seems to have a problem with large areas