glDeleteFramebuffers delete framebuffer object, does it delete texture attached to this framebuffer? - opengl-es-2.0

Platform: Android OpenGL ES 2.0
I am using FBO, there is a texture attached to this FBO, after use, I use glDeleteFramebuffers to release FBO, the question is: Do I need to manually release the texture I created also? or glDeleteFramebuffers will also release the texture attached to it?

I would have thought you'd have to release each texture that you've created as well. There should be a delete call for every create call.

Related

How to draw using Vulkan on gtk4 widget?

Is there an example of how to run vulkan commands on a gtk4 widget?
There are some explanations that it can be done by using Gtk OpenGL widget and then to draw on GL Texture. However, I am not sure how to do it.

SDL2: Share renderer between multiple windows

I have a set of images, and I need show it on different displays. So I create two windows and two renderers. But some image may be show on several displays. And if the texture was created using rendererOne, and shown with rendererTwo, we have a program crash.
If I create texture in runtime each time, when I need show - I have falling of FPS.
How it is better to solve this problem? Can I share renderer between windows (on different displays)? Or can I share texture between different renderers?
p.s. I can mark image's name like "Image1.one.two.png" or "Image2.one.png" and so on, and create two copies of Image1 and one copy of Image2, but it very difficult way, and require many RAM.
p.p.s. I don't use OpenGL directly.
I have solved this problem by using a lazy initialization of texture. I store SDL_Surface, and when I need show some Texture then I check it:
if (m_texture == nullptr || !m_texture->CompatibleWithRenderer(renderer))
{
m_texture = new Texture(renderer, m_surface);
}

Anti-aliasing while rendering to texture in OpenGL ES 2.0

I am rendering my scene into a texture so that I can apply post-processing before displaying the final result. However, when I added this feature, MSAA/CSAA stopped working. Is there a way (other than performance intensive FSAA) to get anti-aliasing to work?
I am targeting multiple platforms (android 2.2+, iphone 3gs+, all ipads), so I am looking for a way to do this without requiring extensions (unless they are ubiquitous).
Yes, MSAA works by default on default frame buffer only. You should use multisample textures .This thread can be helpful:
Multisampled render to texture in ios

How to delete textures in OpenGL 2.x?

I followed this tutorial to create a basic game using OpenGL and after profiling it, discovered that even after a sprite is removed, the textures are not being released creating a memory leak. I easily fixed the problem by creating a cache in the Sprite class, but I would like to know how I can delete the texture itself for future reference. It is loaded with GLKTextureLoader.
GLuint index = self.textureInfo.name;
glDeleteTextures(1, &index);

CCAnimate with sprite file names?

CCAnimate requires CCSpriteFrames, while they require a texture2d.
Is it not possible to simply use CCAnimate by providing my file names? Like anim1.png, anim2.png, anim3.png...
Not directly.
If you are on versions 0.99.*, you can load the files into UIImages, then create CCTexture2Ds using the initWithImage: function, then create CCSpriteFrames.
If you are on version 1.0.0 or later, you can load the textures from files using the CCTextureCache singleton, then create CCSpriteFrames.
However, the whole point behind this API is that you can place all the frames of your animation into one image file, load it as a texture, and then carve out the individual frames using the rect property/argument. This should also improve performance, since the graphics chip only has to load one texture and then perform cheap clipping operation instead of loading multiple textures.
EDIT: Cocos2D has a function for direct CCSpriteFrame loading since version 1.1.