Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have worked with SDL. I would like to know how I cound open the window with opengl context on windows
OpenGL on its own does not acknowledge the existence of the window, or any meaningful concept of a window. You need a windowing API. OpenGL will then have a rendering context passed to it by the windowing API.
<windows.h> is the WIN32 API for Windows, and the prototypical go-to API for creating windows when writing OpenGL applications for the first time on a WinOS computer. I don't know what the equivalents for MACOS and Linux are (X11, maybe?) but they have their own flavors.
For a wide variety of reasons (namely the fact that those APIs are old and arcane and obtuse to work with), there are a lot of APIs that wrap around the native Windowing API, and are much preferred for beginners. GLFW is one such example, and my personal preference, as it works out-of-box for Windows, Mac, and most Linux windowing APIs. SDL is another staple, though I get the sense it has fallen out of favor recently (it seems like it tries to do "too much" on its own).
I don't know the functionality of <glu.h>, but given that the whole thing is deprecated, I don't advise using it.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am interested in GUI application development, and when i search for it i found the only way ahead of me is to master in frameworks like qt, wxWidgets, gtk+, win32 etc. Win32 is ofcourse a native way, but it only run on win pc.
Why c++ standard native libraries does not provide APIs for GUI development?, just like like java.
It has every functions of its own to make a fully featured GUI app..?
Most platforms such as Windows, Mac OSX, Unix, Unix derivatives like Linux, and so forth, provide libraries of callable routines or objects which support GUI development on those platforms.
It might be nice to have a universal GUI library, but that would likely limit its features and aesthetics to a particular format and architecture which would necessarily have to exclude some of the most distinctive and useful features of the platform on which such applications would be used.
So one needs to select a platform for development and anticipate parallel development on alternative platforms. Sometimes aesthetics drives these decisions and sometimes capabilities and performance drives them.
Welcome to an endless adventure, good friend.
No.
GUI require graphics. C++ does not require a graphical environment. Unless you implement an OS yourself with graphics drivers etc in C++ you will not be able to do that.
And if you do, you will have re-invented the wheel (Win32).
Edit: As for java it is practically an OS.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
My university started teaching a course which includes OpenGL programming. They make us use FreeGLUT to create a window and a context for OpenGL, but I found an online course at lynda.com about OpenGL in which they use GLFW instead of FreeGLUT.
So I want to know which one should I use and what are the differences between the two?
FreeGLUT:
Based on the GLUT API.
GLUT has been around for about as long as OpenGL itself.
Many tutorials and examples out there use GLUT.
Takes care of implementing the event loop and works through callbacks (good for simple stuff, makes things like precisely timed animation loops and low latency input much harder though).
GLFW:
Designed from scratch with the experiences of other frameworks in mind.
Gives much finer control over context creation and window attributes.
GLFW-2 Provides basic threading support functions (thread creation, synchronization). –– removed from GLFW-3
GLFW-2 Provides basic image file loading support. –– removed from GLFW-3
Gives very detailed access to input devices.
Event loop is in control of the programmer which allows for much preciser timing and lower latency.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
OK, C++ noob here asking a very nooby question (sorry) but whenever I write my basic programs (helloworld etc.) they always appear in a command prompt window. I want to make proper windows like in Word and other programs. I know it is possible to do this because of all the programs I use every day. But how do I do this in C++? For all the Java veterans out there, I want it to be like a JFrame, but the C++ equivalent.
C++ doesn't have a UI library out of the box, so you need to choose one.
Popular options would be MFC (under Windows/Visual C++) or Qt (with quite a lot additional libraries and features, working on many platforms).
Since you mention Word, it appears that you're on the Windows platform.
Then consider starting with e.g. the Lessons in Windows API Programming (C++) hands-on tutorial.
There are also a great many other tutorials on the net, and books to buy. I just picked the one that I was most familiar with, as the author. Regarding books, the classic book on programming the Windows API is Petzold's "Windows Programming", but I seem to recall that the latest version is for Windows 8 and in C# (earlier version were C/C++).
The tutorial leads you through how to get started with creating window programs using the Windows API (Application Program Interface) direcetly.
This is fairly language independent, but the language used in the tutorial is C++. C++ doesn't have standard library support for GUI stuff. The idea in C++ is that you're free to use whatever third party libraries that you want, or create them, such as the Windows API.
This is highly platform dependent. You can use a GUI cross-platform library, like QT, or use native mechanisms. Under Windows you can use the WinAPI and MFC.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am new to OpenGL. I have to develop a simple 3D application. I read from Google that I have to install GLUT and OpenGL. Is that right? Can you tell what exactly should I install?
Any link for proper download is appreciated.
Google that I have to install GLUT and
You don't need GLUT necessarily. A lot of tutorials use it, though.
OpenGL. Is that right?
Well, OpenGL is mostly an API to the drivers. So what you actually need are the drivers for your graphics processor directly from the vendor. The drivers Windows7 installs automatically lack modern OpenGL support.
So just head over to http://intel.com or http://amd.com or http://nvidia.com, depending on your GPU, and download the drivers for from their site directly and install them.
What I highly recommend is getting GLEW: http://glew.sf.net – it makes things to much easier in the long run. Especially if you want to do anything beyond OpenGL-1.1 you'll have to use the so called extension system which is a bit tedious to use directly. GLEW hides this all behind a single function call to glewInit(), once you've got a OpenGL context.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I really need info about Nokia developing. Can I program Nokia (Symbian) devices only with C++, or I need Qt too? (I have Nokia Qt SDK). I'm not really sure about GUI programing, so I ask for help :)
Also it would be really helpful, if you could tell me how to make something like cmd-style on Nokia (Symbian) <--(this is an optional question)
There are probably multiple ways to accomplish what you're trying to write (as Bala.C pointed out, you can use java), but the latest releases of the symbian OS have really encouraged people to write with Qt and specific with QML. That will likely have the fastest and smoothest interface to the device, because they've spent a fair amount of time optimizing it for the platform. Plus it'll make your application more portable to their N9 and other Qt based phones (the yet-to-ship non-windows Lumia).
I'm sure there is likely an API to tie directly into their lower-level architecture for drawing on the screen as well, but I suspect it's both not-well documented (unlike Qt) and subject to change from release to release as they don't expect developers to be using it as much.
Well, I don't think only C++ will do, but with Java it will be great.
Please go through the following link, it could help you equip yourself for Nokia Symbian Development.
http://www.developer.nokia.com/Develop/Web/Web_runtime.xhtml
Good luck