Need help regarding graphics in C language....

Solid Link

Walk the path of the walky...
Supervisor
Dec 13, 2008
1,554
165
69
Under a rock
www.pakgamers.com
Hey every1.... i wanted to ask a few questions regarding how you go about making graphics and such in C language...
basically m learning C right now and we'v covered all the basics like looping , pointers arrays and stuff... but what i wanted to know is that how to implement graphics in C and not C++, is there a way..? If so then please tell me the details like what libraries should i go for and how to start and what knowledge and background stuff that i need to know in order to start it out like that and if thats not possible on C then please do let me know how should i go about making it on C++, like where to start and all... thankyu..
 

ammarzubair

Perverted Gentleman
Feb 15, 2009
1,684
0
41
Karachi
depends on what you want... i suggest you start with console based graphics...

a simple program
Code:
# include<graphics.h># include<stdio.h>
# include<conio.h>

main()
{
int driver, mode;

driver=DETECT;
mode=DETECT;
initgraph(&driver,&mode,"\\tc\\bgi");
cleardevice();

bar3d(50,100,550,500,50,50);
circle(150,200,100);

circle(300,200,100);

circle(450,200,100);
getch();
closegraph(); [COLOR=#000000][FONT=Courier New]}[/FONT][/COLOR]
 
Last edited:

Solid Link

Walk the path of the walky...
Supervisor
Dec 13, 2008
1,554
165
69
Under a rock
www.pakgamers.com
depends on what you want... i suggest you start with console based graphics...

a simple program
Code:
# include<graphics.h># include<stdio.h>
# include<conio.h>

main()
{
int driver, mode;

driver=DETECT;
mode=DETECT;
initgraph(&driver,&mode,"\\tc\\bgi");
cleardevice();

bar3d(50,100,550,500,50,50);
circle(150,200,100);

circle(300,200,100);

circle(450,200,100);
getch();
closegraph(); [COLOR=#000000][FONT=Courier New]}[/FONT][/COLOR]
well basically speaking m doing cause i wana make a small game as my project for the uni.. so can u tell me if this library will help me in making animating and stuff.? like a 2d sidescroller or something.? thanx for ur reply though..
 

ammarzubair

Perverted Gentleman
Feb 15, 2009
1,684
0
41
Karachi
well basically speaking m doing cause i wana make a small game as my project for the uni.. so can u tell me if this library will help me in making animating and stuff.? like a 2d sidescroller or something.? thanx for ur reply though..
not really... but take it one step at a time... this is just simple 2d graphics
 

Behrox

Seasoned
Nov 9, 2011
2,578
0
41
28
Karachi,Pakistan
well basically speaking m doing cause i wana make a small game as my project for the uni.. so can u tell me if this library will help me in making animating and stuff.? like a 2d sidescroller or something.? thanx for ur reply though..
use Allegro. We made a Pacman game in it for 2nd semester uni project. Plus it has many tutorials online while being easier to learn
 

prohyper

Proficient
Aug 24, 2011
837
0
21
[MENTION=43322]Behrox[/MENTION] [MENTION=9907]ammarzubair[/MENTION] guys the OP is banned [emoji14]

Sent from my Nexus 4
 
General chit-chat
Help Users
IMPORTANT: Please Change Your Passwords to avoid being botted. | Click for Discord
  • No one is chatting at the moment.
  • Chandoo Chandoo:
    LegacyGamerGuy said:
    Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of Hellblade 2 is just not worth the $50 price tag.
    Score 1 for game pass. I wouldn't pay full price for this at retail either.
    Link
  • L LegacyGamerGuy:
    Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of Hellblade 2 is just not worth the $50 price tag.
    Link
  • L LegacyGamerGuy:
    Just downloaded my first legit digital PC game on GoG at a discount of $8: Two Point Hospital. The same team behind Theme Hospital Two Point Studios now part of Sega. And I am having more fun than most recent AAA games except of course BG3.
    Link
  • Chandoo Chandoo:
    gottdamnnn HB2 looks amazing. UE5 finally living up to its potential.
    Link
  • L LegacyGamerGuy:
    Still, I don't like either Sony or Microsoft as they are focusing more on corporate greed than delighting customers. PC gaming is best of gaming and worth every penny.
    Link
  • L LegacyGamerGuy:
    PC Gamer score of 58/100 for Hellblade 2??? Is it really worse than Gollum that was 64/100? Microsoft games can't even come close to high scores of Sony exclusives apparently.
    Link
  • Necrokiller Necrokiller:
    Chandoo said:
    Hellblade 2 83 OpenCritic, not bad at all. 2 points higher than the first game.
    first one is 84 Opencritic. Saga dropped to 82.
    Link
  • Necrokiller Necrokiller:
    Saeen abhi tak to first one was better in every way. Atleast the first hour-ish
    Link
  • Chandoo Chandoo:
    Hellblade 2 83 OpenCritic, not bad at all. 2 points higher than the first game.
    Link
  • L LegacyGamerGuy:
    About the Microsoft (and Sony) debate, I feel both have become too greedy and losing their minds over corporate greed. Personally, I will never buy any console next gen and switch to PC gaming where democracy reins.
    Link
  • L LegacyGamerGuy:
    No news about Google Play Store hacking. What is the source?
    Link
  • Link
  • Aciel Aciel:
    This is the error.
    Link
  • Aciel Aciel:
    Online session is enabled for UBL. I have an active subscription with my NayaPay card (it is already added to Google Payment Methods).
    Link
  • B Baghi:
    did you try setting up Google Payments? For UBL you may have to get it enabled for internet transactions, Naya should work without it!
    Link
  • Aciel Aciel:
    I tried both NayaPay, and UBL, but I keep getting "correct country selected..." error. I already have PK set there 🤦‍♂️
    Link
  • Aciel Aciel:
    Baghi said:
    Link
  • B Baghi:
    Yes
    Link
  • Aciel Aciel:
    Does your VISA Cards work on Google Play Store?
    Link
  • M murtaza12:
    XPremiuM said:
    Why? Was the site hacked or something?
    Yes
    Link
  • XPremiuM XPremiuM:
    GloriousChicken said:
    Everyone, please change your passwords.
    Why? Was the site hacked or something?
    Link
  • GloriousChicken GloriousChicken:
    Everyone, please change your passwords.
    Link
  • Necrokiller Necrokiller:
    The only valid thing from his pov he said in the video is AC dead since Black Flag. According to woke police that game was woke too. Welsh man in West Indies. So atleast he's consistent I guess lol
    Link
  • Link
  • XPremiuM XPremiuM:
    Necrokiller said:
    It's based on an actual real life person so I don't think the woke police have a valid case here.
    Nope. They have a very valid case. The above video explains it all.
    Link
    Chandoo Chandoo: Gradually transitioning from console gaming to PC as the games are not worth it. 6 hours of...