protected void CreateWarningTexture()
{
// Generate warning texture
int width = 8;
int height = 8;
// TODO convert to 5_6_5
unsafe
{
int* data = stackalloc int[ width * height ];// 0xXXRRGGBB
//yellow / black stripes
for ( int y = 0; y < height; ++y )
{
for ( int x = 0; x < width; ++x )
{
data[ y * width + x ] = ( ( ( x + y ) % 8 ) < 4 ) ? 0x000000 : 0xFFFF00;
}
}
// Create GL resource
OpenGL.GenTextures( 1, ref _warningTextureID );
GLESConfig.GlCheckError( this );
OpenGL.BindTexture( All.Texture2D, _warningTextureID );
GLESConfig.GlCheckError( this );
OpenGL.TexImage2D( All.Texture2D, 0, (int)All.Rgb, width, height, 0, All.Rgb, All.UnsignedByte, (IntPtr)data );
GLESConfig.GlCheckError( this );
}
}
}