Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
What header file should I include to use graphics in Visual C++? I use Visual Studio 2010. Thank you in advance!
"Graphics" is a broad subject. Native Win32 applications do not require any extra libraries but are very low level (ie You write a lot of code yourself). I found this website very useful. You can find others by searching up "win32 tutorial". You will need to include "windows.h" and possibly "windowsx.h" for this.
Two main competing APIs (Application Programming Interfaces) are DirectX and OpenGL. You can search them up as they are widely used for graphics and you should get some good resources and tutorials. These two will may need extra libraries which you can get from the internet (just search it). For DirectX the headers, it will vary on which version of DirectX you use and OpenGL will require "gl/gl.h" and possibly others depending on what you want to do.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I wanted to ask if anyone of you knows if there is a setting or plugin for Visual Studio 2015 Enterprise to automatically include any missing things, example if a namespace is missing or if "endl" is missing it includes the class.
Thanks!
I'm afraid not only can I not find / am not aware of such a plugin - I doubt it will ever exist.
The problem comes that without knowing every include file on your computer (which is a very time consuming/hard process), how could said plugin know which one you wanted?
Example:
I have marmalade (A cross platform development tool), Cygwin-Dev (A windows unix-shell), a GCC-cross compiler and visual-studio installed.
This means my computer has four (if not more) versions of "iostream", as well as several different implementations of the standard library (for different platforms).
How could such an add in know "which" include I wanted?
Personal opinion:
I understand what you are looking for, but honestly - even if such a tool did exist, I would advise against using it. when you get beyond simple example "hello world" programs and alike, C++ include files become a non-trivial subject. A single project I am involved in professionally has near two-thousand header-files, ranging from Iostream, though to third-party libraries, and near a thousand home-grown files.
Managing and understanding what to include and where is an essential skill of the C++ programmer, and quickly becomes second nature.
P.S.
Remember that every function on sites such as en.cppreference.com/w/ will state at the top of the page what header file you need to include them. Reading such reference pages will (also) become second nature in due time.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I started teaching myself C++ a little while back, and I am wondering, how do you use images in your code, so I started digging around a little, and saw people talking about different libraries. Can someone give me a simple explanation of what the library is, what it does so that C++ can display images, why it is this way, and how would you use one?
I use flash and so to me a library is where all the images are stored and where you call them from using pointers, is this similar to what these 3rd party programs do to c++?
I'm going to guess this question will be closed as too noob (sorry, see faq).
But to answer you question, library in C++ = "a collection of C++ functions and or classes.". It can either be in the form of a bunch of source code files that you just include in your program, or it can be in some OS specific format like a .so (linux), .dll (windows), framework (osx) along with header files you reference in your code.
Displaying an image in C++ is usually not so straight forward because it's different on every platform. C++ the language works anywhere but the libraries for each OS are different. How to open a window, surface, how to get input from the mouse, keyboard, screen, etc. In other words we can't tell you how to do display an image unless we know what machine you're on.
There are C++ libraries that try to hide some of these cross platform issues. Two that come to mind are SDL (http://www.libsdl.org/) and Qt (http://qt-project.org/)
SDL is probably more appropriate for games or similar. Qt is more appropriate for apps. Or least that's my impression. I've used neither.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I really like this Particle Emitter software here:
http://www.astralax.com/projects/particles
They have an API and even an OpenGL Wrapper for IOS but I cannot figure out how to integrate these particle emitters in to my standard UIKit Xcode project.
They have a sample for Cocos2dX (not interested in that) and they have a sample using OpenGL (which is pretty advanced) but no easy sample of how I can integrate to my existing standard Xcode projects referencing from my standard .h and .m files.
Has anyone figured out how to use this program with basic Xcode?
EDIT: I guess it says I am "Off Topic"...never seen that here before. Curious, I didn't even know there was a specific topic going on. I'm confused (sort of why I made the post in the first place).
You can use CAEmitterLayer extented from CALayer. See Apple documentation.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to use C++ for opengl and python for scripting various social api calls. IS there a better option?
Prototype with your OpenGL calls in python - it is much quicker to prototype than C/C++ and then see if it is quick enough - if it is then you are done - if not then find the bottlenecks and consult the documentation on C/C++ plug in to address those issues.
Note that there are python OpenGL bindings available here which already use C/C++ on the OpenGL side so should be as fast as anything you are likely to come up with quickly.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I want to run a very simple c++ code in microsoft visual c++ but I can't.
In my c++ book , they told me that I can do it but it requares some steps and I don't know how to do.
So , please tell me how to do it.
Thanks
Check this out, basic C++ Win32 application build in Visual Studio
http://msdn.microsoft.com/en-us/library/bb384843.aspx
Get used to using MSDN, it's very helpful for answering questions on programming for Windows in Visual Studio. A lot of sample code, both for common tasks and API-specific.