You are talking about some disparate technologies there. You can't really compare then in the same sentence. Also, your question is very restrictive in that you are asking about C++ libraries for the Mac that you can use with Xcode. Such things do exists, but if you are still learning Xcode, they may be too difficult right now.
I would recommend narrowing down exactly what you want to do on the Mac - graphics-wise. It may be something that you could easily do in Cocoa or Carbon without getting overwhelmed.
A good place to start would be to look at the Developer examples and find one that does something similar to what you want. Study that example and adapt it. It may not actually use C++, but then, that is a different issue. Learning C++ and learning graphics do not really go together. You can do one - and the other - and eventually combine them - but not at first.
I would recommend narrowing down exactly what you want to do on the Mac - graphics-wise. It may be something that you could easily do in Cocoa or Carbon without getting overwhelmed.
A good place to start would be to look at the Developer examples and find one that does something similar to what you want. Study that example and adapt it. It may not actually use C++, but then, that is a different issue. Learning C++ and learning graphics do not really go together. You can do one - and the other - and eventually combine them - but not at first.
It tells the compiler that what graphics driver to use or to automatically detect the drive. In all our programs we will use DETECT macro of graphics.h library that instruct compiler for auto detection of graphics driver. GraphicsMode: It is a pointer to an integer that specifies the graphics mode to be used. If.graphdriver is set to DETECT. Also as others have stated graphics.h appears to be a custom header file so you should be able to just copy it and the corresponding source file (if it has one) from your machine but chances are it.
How to use graphics.h in latest IDE's & Editors 2018
Just Follow the Steps for CODE::BLOCKS :-
- Clone the files from this repository. And download the Code::Blocks.
- Now copy the graphics.h & winbgim.h header files in
C:Program FilesCodeBlocksMinGWinclude
directory. - Now copy the libbgi.a library file in
C:Program FilesCodeBlocksMinGWlib
directory.
Note:
It may possible that your codeblocks installation is in another folder like Program Files(x86) by default codeblocks is installed in this directory. So find your path accordingly.- Now open your codeblocks and go to
Settings > Compiler Settings > Linker Settings
. Click onAdd
to link libraries and browse your libbgi.a library file; should be likeC:Program FilesCodeBlocksMinGWliblibbgi.a
. - In Linker Settings paste these linkers in Other linker options.
- Cheers
? ? Now run any graphics program. Remember that your program should be like name_of_file.cpp
. BecauseC
doesn't support sstream.
For Dev C++ you have to do the same upto Linker step. You need to add linkers with the project, just paste the linkers in
Project Options > Parameters > Linkers
. Or You can do it every project by pasting it in Tools > Compiler Options > General > in second textbox
Just Follow the Steps for Atom :-
- Clone the files from this repository. And download the Atom.
- Download the GCC compiler MinGW. And install it. Mark all options for installation.
- Set the path for the compiler. Go to
Control Panel > System > Advanced System Settings > Environment Variables > Path > Edit > New > paste C:MinGWbin
- Now open the Atom and install a package
gpp-compiler
from press (ctrl + comma) it'll open settings > Install. - After that paste those linkers, go to
Open settings > Packages > Settings of gpp-compiler package > C++ Compiler Options
. - Done! Create new file and press f5 to run the program.
- First Download the suitable binary file, according to your Linux OSThe current release of SDL_bgi is 2.2.3. To compile it from sources, you will need a compiler (gcc or clang are fine), make, and SDL2. On Debian and Ubuntu-like distributions, you will need the package 'libsdl2-dev' and its dependencies.
Building has been tested on GNU/Linux Mint 18.*, Fedora 26, Windows (MSYS2 + mingw-w64, Code::Blocks, Dev-C++ ), and Mac OS X Yosemite.
- Sources: SDL_bgi-2.2.3.tar.gz
- Source RPM package: SDL_bgi-2.2.3-1.src.rpm
- 64 bit binary RPM package (Fedora): SDL_bgi-2.2.3-1.x86_64.rpm
- 64 bit binary DEB package, for Debian-like Linux distributions: sdl_bgi_2.2.3-1_amd64.deb
- binaries for Windows (MSYS2 + mingw-w64, CodeBlocks, Dev-C++):
SDL_bgi-2.2.3-win.zip - Previous versions sources:
SDL_bgi-2.2.2.tar.gz
SDL_bgi-1.0.1.tar.gz
- To compile a program using SDL_bgi, make sure that it includes the 'graphics.h' header file. Then:
gcc -o program program.c -lSDL_bgi -lSDL2
- If you want to integrate this with your favourite editors the simply add linker.
-lSDL_bgi
-lSDL2