Giter Site home page Giter Site logo

computer_graphics_cpp's Introduction

Computer Graphics using cpp

From installing IDE, graphics library, different functions with code and syntax , I am uploading in here.

STEPS TO INSTALL AND SETUP graphics.h in CODE::BLOCKS IDE.

1. Install Code::Blocks IDE from this link, which is easy to work with C/C++.

Computer Graphics(CG) is old library but basics of CG becomes clear using graphics.h library and its functions. (If above CodeBlocks version don't works for you or shows errors, try this 17.12 version

2. We need to download header files for graphics to work in our machine. Download 3 files from here.

3. Add graphics.h and winbgim.h

Copy and Paste graphics.h and winbgim.h in the "include" folder inside MINGW folder of CodeBlocks folder in your machine. Generally the path is C:\Program Files (x86)\CodeBlocks\MinGW\include

4. Copy and Paste libbgi.a file in "lib" folder inside MINGW folder of CodeBlocks folder in your machine.

Generally the path is C:\Program Files (x86)\CodeBlocks\MinGW\lib

5. After adding these libraries, do these setting in CodeBlocks IDE.

  • In the Code::Blocks IDE, open Settings-> Compiler in menu bar.

  • In the Popup Box appeared, click on Linker settings next to compiler settings.

  • Add the Path of libbgi.a in "Link libraries" by clicking on Add button and then Browse Icon. Address of the file might be like this C:\Program Files (x86)\CodeBlocks\MinGW\lib\libbgi.a

  • Then add (copy/paste) this below code in Other linker options, on right side of where you just added the path of libbgi.a file.

                                  -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
    
  • Click on OK button to apply these changes and then close the application and then Restart your PC/Laptop.

6. Open Code::Blocks IDE after restarting is done and copy/paste this sample code to test the working.

Save file in C++ language with extension .cpp OR you can make project as console application in C++ and file is saved by default as main.cpp in codeblocks. Output will be generated in the window of size 640x480

If you have some error in codeblocks 20 version, then follow this video. Maybe it will solve your issue.

Suggested by Meet

STEPS TO INSTALL AND SETUP glut.h (OpenGL library) in CODE::BLOCKS IDE.

1. Install CodeBlocks from link given above if you haven't yet.

2. Download these files in your PC/Laptop.

3. Follow steps given in this link.

computer_graphics_cpp's People

Contributors

chawlajay avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.