Search code examples
c++windowscocos2d-xcocos2d-x-3.0

Texture2D: Error uploading compressed texture level: 0. glError: 0x0500


i created new project i added:

 Size winSize = Director::getInstance()->getWinSize();
  RenderTexture* pRenderTexture  = RenderTexture::create(winSize.width, winSize.height, Texture2D::PixelFormat::BGRA8888); 

and i keep getting this error:

cocos2d: Texture2D: Error uploading compressed texture level: 0 . glError: 0x0500
Assert failed: Could not attach texture to framebuffer
Assertion failed!

by the way the cpp-test RenderTexture example do work . what im doing wrong here ?

Using:

  • cocos2d-x v3.3
  • win7 32bit

Solution

  • It means that BGRA8888 is not supported by your opengl. Use RGBA8888 if it suitable for you. And you have typo:

    RenderTexture* pRenderTexture; = RenderTexture::create
    _____________________________^