Author Topic: Graphics in Visual C++ 2012  (Read 3773 times)

0 Members and 1 Guest are viewing this topic.

Offline IAmAPerson

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Graphics in Visual C++ 2012
« on: August 28, 2013, 07:12:02 pm »
Hey guys! I've gotten pretty good at C++, and I want to start doing things with graphics. I searched Google for help, but it just returned these old websites that are outdated by about 10 years... Can someone help me? Please do NOT post links to another website, I'd like an explanation please. Also, please include some sample code! I'm hoping to soon be able to make a program to be able to move a ball around the screen. REMEMBER - I am using Visual C++ 2012. Please help me in that language. I know nothing about graphics. All I know about graphics is that it is possible. :banghead:
Main programmer and developer for Minecraft DS!
Currently working on Beta 2.0
Wiki page! Minecraft DS
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/8a6534f9cb6212b1.png" alt="NerdTests.com says I'm a Light-Weight Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Graphics in Visual C++ 2012
« Reply #1 on: August 28, 2013, 07:57:06 pm »
Graphics using just C++ and OS API's is downright hellish. Personally, I use SFML for all my graphics, audio, networking, and input handling. It's pretty capable, comparable to SDL.

http://www.sfml-dev.org/

Here's some code to get you started:

http://pastebin.com/UyWeRy4W

Edit: It may do well to offer a bit of actual explanation of what is going on in the code. Basically, all we are doing is setting up a window, creating a view for that window, as well as a clock for smooth movement and a drawable object.

Then we enter the main loop which reads events, then inputs, then acts on those inputs. Afterwards, we clear the screen, draw everything, then update. that's basically everything going on in your basic graphics program, read, process, output. Or in this case, events, inputs, update, draw.

Edit 2: It should also be noted that Visual C++ 2012, is just C++ compiled using MSVC 2012. It's no different than C++ compiled with, say, GCC, save for little C++0x and no C++14 support and some MSVC features added to it.
« Last Edit: August 28, 2013, 08:35:46 pm by Scipi »

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Graphics in Visual C++ 2012
« Reply #2 on: August 28, 2013, 09:24:54 pm »
Depends if you go managed with the .NET framework or not. Personally, I use Visual C# with Windows Forms and it have a nice interface to draw graphics called GDI+, C++ might have the same.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Graphics in Visual C++ 2012
« Reply #3 on: August 28, 2013, 09:41:47 pm »
I would reccomend SDL2 which is a more C/barebones way of graphic programming. There are some good tutorials written for it so I'll just link to those since I don't have the skill to do better.

http://libsdl.org/ download and information

http://lazyfoo.net/tutorials/SDL/index.php tutorial.

I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline IAmAPerson

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: Graphics in Visual C++ 2012
« Reply #4 on: August 28, 2013, 10:54:10 pm »
Thanks guys!
Main programmer and developer for Minecraft DS!
Currently working on Beta 2.0
Wiki page! Minecraft DS
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/8a6534f9cb6212b1.png" alt="NerdTests.com says I'm a Light-Weight Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>