// Class for CFrameBufferObject (container for FBO rendering) CFrameBufferObject::CFrameBufferObject(unsigned int width, unsigned int height, unsigned int Bpp, bool bUseFloat, GLenum eTarget) : m_Width(width), m_Height(height), m_bUseFloat(bUseFloat), m_eGLTarget(eTarget) { // reserved for future usage if (Bpp) { } #if NEW_FBO_CODE glGenFramebuffersEXT(1, &m_fboData.fb); m_fboData.colorTex = createTexture(m_eGLTarget, width, height, (bUseFloat ? GL_RGBA32F_ARB : GL_RGBA8), GL_RGBA); m_fboData.depthTex = createTexture( m_eGLTarget, width, height, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT); attachTexture( m_eGLTarget, m_fboData.colorTex, GL_COLOR_ATTACHMENT0_EXT ); attachTexture( m_eGLTarget, m_fboData.depthTex, GL_DEPTH_ATTACHMENT_EXT ); // bool ret = checkStatus(__FILE__, __LINE__, true); #else // this is th eoriginal FBO path initialize(width, height, m_fboConfig, m_fboData); CHECK_FBO; #endif }
MonsterEntity::MonsterEntity(Type type, unsigned int hitpoints) : sprite(), texture(), hitpoints(hitpoints), type(type), timer(0), alpha(true) { if (type == monster_flyer) { attachTexture("Assets/Textures/monsters.png"); sprite.setTextureRect(sf::IntRect(0,0,64,64)); setVelocity(-100,0); } else if (type == monster_crawler) { attachTexture("Assets/Textures/monsters.png"); sprite.setTextureRect(sf::IntRect(0,64,64,64)); } }
void ofFbo::createAndAttachTexture(GLenum internalFormat, GLenum attachmentPoint) { ofTexture tex; tex.allocate(settings.width, settings.height, internalFormat, settings.textureTarget == GL_TEXTURE_2D ? false : true); tex.texData.bFlipTexture = false; tex.setTextureWrap(settings.wrapModeHorizontal, settings.wrapModeVertical); tex.setTextureMinMagFilter(settings.minFilter, settings.maxFilter); attachTexture(tex, internalFormat, attachmentPoint); }
//---------------------------------------------------------- void ofFbo::createAndAttachTexture(GLenum internalFormat, GLenum attachmentPoint) { ofTextureData texData; texData.textureTarget = settings.textureTarget; texData.width = settings.width; texData.height = settings.height; texData.glInternalFormat = internalFormat; texData.bFlipTexture = false; texData.wrapModeHorizontal = settings.wrapModeHorizontal; texData.wrapModeVertical = settings.wrapModeVertical; texData.magFilter = settings.maxFilter; texData.minFilter = settings.minFilter; ofTexture tex; tex.allocate(texData); attachTexture(tex, internalFormat, attachmentPoint); dirty.push_back(true); activeDrawBuffers.push_back(GL_COLOR_ATTACHMENT0 + attachmentPoint); }
void GFXPCD3D9TextureTarget::zombify() { for(int i = 0; i < MaxRenderSlotId; i++) attachTexture(RenderSlot(i), NULL); }
//---------------------------------------------------------- void ofxFbo::attachTexture(ofxTexture& texture, GLenum attachmentPoint) { attachTexture(texture.texData.textureID, attachmentPoint); }
void GFXD3D11TextureTarget::zombify() { for(U32 i = 0; i < MaxRenderSlotId; i++) attachTexture(RenderSlot(i), NULL); }
MonsterEntity::MonsterEntity() : sprite(), texture(), hitpoints(100), type(monster_flyer), timer(0), alpha(true), gravity(sf::Vector2f(0.f,300.f)) { attachTexture("Assets/Textures/monsters.png"); sprite.setTextureRect(sf::IntRect(0,0,64,64)); }