I'm wondering if opengl can automatically manage offscreen rendering. I mean if it can detect and ignore sprites and textures if they are rendered out of screen.
if it makes any difference i'm targeting opengl-es 2.
To bind a texture in OpenGL-ES 2.0, the texture must be in memory. Whether or not the texture gets used depends on whether an object remaining in the viewable scene uses that texture. So, yes, it can ignore the texture for rasterization, however, to your point of a 2048x2048 texture on a 480x320 screen, as the Apple "OpenGL ES Programming Guide for iOS" states on page 71:
Reduce Texture Memory Usage
Reducing the amount of memory your iOS application uses is always an important part of tuning your application. However, an OpenGL ES application is also constrained in the total amount of memory it can use to load textures.
And on page 72:
Use Properly Sized Textures
The images that an iOS-based device displays are very small. Your application does not need to provide large textures to present acceptable images to the screen. Halving both dimensions of a texture reduces the amount of memory needed for that texture to one-quarter that of the original texture.
Before shrinking your textures, attempt to compress the texture or use a lower-precision color format first. A texture compressed with the PVRTC format usually provides higher image quality than shrinking the texture—and it uses less memory too!
You can apply the same logic to most OpenGL-ES 2.0 devices, since they each have limited memory.
If an object, when translated to the 2D display, is not within the buffer's dimensions then OpnGL will do nothing with the data.. However it still has to do a bit of processing to get to that point so it is still considered better practice to only send things to OpenGL that actually have a chance of being seen on the screen in one manner or another.
Scene Graphs are the constructs that are commonly used to determine which objects to send down the graphics pipeline for processing or not.
Hope this helps.
I mean if it can detect and ignore sprites and textures if they are rendered out of screen.
In general, if you're thinking solely in terms of 2D graphics, "sprites and textures", rendering performance is not going to be a concern. Not on any hardware you can actually have bought in the last 8 years.
You might be drawing, what, a few hundred quads every frame? Maybe a thousand, tops? You could do that on a Voodoo 1 at 60fps no problem, and that was with software T&L.
You don't need to concern yourself too much with parts of quads that happen to be off-screen. GPUs aren't stupid; they will not do work that will not have a visible effect. Remember: hardware makers make money based on how fast their cards go. And spending time on the part of a triangle that's off-screen is time that could have gone to stuff that's on-screen.
Now, that being said, it's not a bad idea to do some simple visibility checks to see if a quad is actually on screen or not. But the key word is "simple". At no time should you modify a quad so that you're only rendering the visible portion; just let the GPU do its job.