Hello to all of you
I have been using Turbo C++ for last 6 mounths and do all my graphics very fine. But when i started using Vc++, graphics.h was not including there.
Can any one of u tell me to how to start graphics programming in Vc++ using same functions as they were in Turbo C++.
OR give some links so that i can learn about this..
Waiting for all your replies..
Thankyou..

Dani AI

Generated

Short answer for : graphics.h is the old Borland BGI header (DOS-era) and is not part of Microsoft Visual C++ (MSVC), so a straight #include <graphics.h> will fail under VC++. As pointed out, you can either (A) use a compatibility port that implements the BGI API on Windows, or (B) move to a modern graphics library or Windows API and rewrite the drawing calls. (en.wikipedia.org)

If keeping your Turbo C++ code (minimal changes) is important, use a BGI port such as WinBGIm or SDL_bgi. WinBGIm provides the familiar initgraph/initwindow/line/circle functions; SDL_bgi is a BGI-compatible layer built on SDL2 for cross-platform use. Note: many WinBGIm builds target MinGW/g++; Visual Studio (MSVC) users may need a community MSVC build or a 64-bit recompile. Example BGI-style code (works with WinBGIm/SDL_bgi):

#include <graphics.h>

int main() {
    initwindow(640, 480);
    circle(320, 240, 100);
    getch();
    closegraph();
    return 0;
}

See the WinBGIm docs and SDL_bgi project for install and linker details. (winbgim.codecutter.org)

Longer-term (recommended) choices: SDL or SFML for simple 2D games/apps; Allegro is another well-supported game library; OpenGL (with helpers like GLFW) or modern APIs (Direct2D/Direct3D/Vulkan) are better for hardware-accelerated work. These libraries have solid Windows guides and prebuilt SDKs so you can get started without wrestling with old BGI toolchains. (libsdl.org)

Practical workflow: decide whether you need quick compatibility (use WinBGIm/SDL_bgi and run under MinGW or a community MSVC port) or want a modern learning path (pick SDL/SFML/Allegro/OpenGL, use the project templates or package managers to add them). If you try WinBGIm and see linker errors about libbgi, check for 32-vs-64-bit mismatch or follow one of the community build instructions for a modern toolchain. (github.com)

Relevant resources (searchable by name): WinBGIm, SDL_bgi, SDL, SFML, Allegro, LearnOpenGL, GLFW.

Recommended Answers

All 6 Replies

i think that there is no dos graphics library in vc++.
directx, win api, opengl, allegro, etc. should be used

Ok but how to start. give me some links .
regards.

Hi Letmec,
Did u find the solution for this? Even i am facing same problem...
Plz help me. Thanks in advance..

Hello to all of you
I have been using Turbo C++ for last 6 mounths and do all my graphics very fine. But when i started using Vc++, graphics.h was not including there.
Can any one of u tell me to how to start graphics programming in Vc++ using same functions as they were in Turbo C++.
OR give some links so that i can learn about this..
Waiting for all your replies..
Thankyou..

This thread is almost 5-years old. Considering the OP's post count, they've probably long since moved on. Just look at typek's links and be done with it.

If they don't help, start a new thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.