With FreeBasic I can create and open a new screen with a function ScreenRes
. For example,
#include "fbgfx.bi"
ScreenRes 640, 480, 32
Sleep()
will create a 640 x 480 screen with depth 32.
So, is there any function in C++ that equivalent with that?
Note: I'm using Ubuntu 14.04. I'm prefer cross-platform or linux-based functions than a windows-based.
No, there is not. C++ itself is a very pure language and contains only basic functionality (e.g. generic lists, sorting algorithms, strings or memory-management tools). I don't know FreeBasic, but judging from your question, it seems to be one of those languages which have a lot of specific high-level functionality already included in them. This can be a curse or a virtue, depending on your requirements.
If you need graphics in C++, then you "must" (==> curse) or "can" (==> virtue) use a 3rd-party library which fits exactly your needs. For complete pixel-wise control over the screen, consider SDL.