Where exactly do I add my BMP files in my OpenGL C++ project? Using Xcode for the Mac - c++

I have my code working perfectly on Visual Studio C++ with OpenGL. The code is able to call the images folder. And when I run the program the images show up on my application.
Now I am trying to run my OpenGL C++ program on my Mac. Everything compiles and runs. However, the images that I use are not showing up.
Here is a screenshot of how my project directory looks. I have the images inside the texture folder.
Is there specific place where I need to put my texture folder so they will be able to be loaded? Like I said it works fine on the windows visual C++.

Given the screenshot you posed in the comments, it could be because you're using backslashes for the path separators. UNIX-based systems (Mac, Linux, BSD, etc.) use forward slashes to separate directories - Windows is fairly unique in using the backslash. Conveniently, Windows functions will accept paths with forward slashes anyways.

Related

C++ Setup in Visual Studio Code fails to run

I just downloaded VSC in order to start learning C++. Previously I had just used Notepad++ for web design and Python IDE for Python, but I decided to move onto Visual Studio Code for a more sophisticated code editor.
However, when trying to run a basic program, I don't have the option to run in the first place. This picture is what's supposed to come up when you right-click on the text area (from multiple YouTube tutorials):
However, this is what comes up on my screen.
Additionally, there is no "run" button on the top-right of the screen like the tutorials show.
My folders regarding VSC in File Explorer are quite simple. I have a folder for my .cpp code, and MinGW as a compiler. My build is Windows 10.
Obviously, this depends from person to person, but is there any key way this situation can be resolved? Thank you in advance.

Using Cmake to generate C++ Visual Studio project

So this is a tricky problem I have. I have an open source object tracking algorithm that runs well on Windows using Visual Studios 2013. Now, I have another algorithm using stereo vision that output two images, but this is done in Ubuntu using Cmake. My goal is to output this two images and pass them through the object tracking code.
What I want first is to make the algorithm that runs in Windows, work using cmake in Ubuntu. For this I guess I will need a CMakelists.txt for the path files. Might this be possible? The code do object color tracking using a monocamera connected to the PC. What should I do?
Any suggestion will be appreciated. Thanks!

Working with Stellarium API

I am having trouble integrating the Stellarium API with any IDE. I have tried Visual Studio 2013 and Qt Creator, and both seem to not recognize anything that has to do with Stellarium.
How do I get to a point where I can use all the classes and functions found in the Stellarium Developers Documentation and integrate them into my code?
The program I am trying to create is one which goes over a given list of dates and locations (on Earth) to output when and where a given object is seen high enough in the sky (Altitude of 30° minimum), during the night and with no moon interruption so that a successful observation could be made. For that, I need Stellarium and its functions.
Any ideas?
What I've done that worked was use a cmake GUI application to prepare the build, you just need to supply its dependencies and click in configure and generate, remembering to select the compiler from visual studio, like msvc 20.. 64 bits with opengl support. After that a visual studio project will be generated in the folder that you choose. When you open this project, to compile you just need to build the stellarium item on the list and after that, the install item. When it be done, just go to source's code folder and use the file install.iss, you must have installed the inno setup compiler.

fltk, opengl, textures and SOIL in visual studio 2013

I have made an application in c++, using FLTK 1.3.2 on Mac OSX and am happy with its functionality and now need to produce a Win32 version (a motivating reason for using FLTK)
I can get basic FLTK code to run on Windows now, but have come up against several issues:
1) Despite building my project as a release version whenever I launch the application is launches out of a command prompt. How do I stop this?
2) On Mac all resources can be included in the app bundle and then loaded as files from the app bundle path. Is seems that there is no equivalent in Windows; I have to include images (for instance) as a resource. The problem is that two distinct bits of functionality need a path to the image I want to use namely:
a) Fl_PNG_Image class where the syntax is Fl_PNG_Image a_guide("path/myfile.png");
b) SOIL image loader where the syntax is texture= SOIL_load_OGL_texture("path/myfile.png", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS);
I want just a standalone application without the need to bundle folders with resources that need to be in the right place. How can I include files as a resource in Visual Studio and then use the with SOIL/Fl_PNG_Image and if not what else would people normally do in such a situation?
Thanks.

Phonon problem in Windows 7 with code compiled in XP

I have some code compiled using Visual Studio 2010 (C++), with Qt for the GUI and Phonon to show some videos.
I compile and run the code in a Windows XP machine and everything works fine. The videos and controls are shown correctly, and the same in other Windows XP machines. But at the moment that I try to use a Windows 7 machine, the video is not shown. Phonon controls are loaded, I can adjust the size of the Phonon VideoWidget but nothing is shown. I am using the SetFile method to indicate the file location and I have also tried (of course, with no luck) with setCurrentSource in the MediaObject (it works, though, in Windows XP).
I have tried different locations of files (absolute/relative) but nothing seems to work. Also, in XP when a video is not found an alert message is shown while in Windows 7 there is no error message, but also no video is shown. If I try to open the videos with other players, they work fine (I tried also with videos with different formats).
Any idea on what can be wrong? Is there something that I am missing with Phonon and Windows 7? Thanks!
When deploying your application to a different computer, make sure you don't forget to copy the Phonon backend. Not just the DLL contained in it (the ds backend for me), but also the directory itself.
That is
-Application Directory
¦-myexe.exe
¦-phonon_backend
¦-phonon_ds94.dll
Furthermore the Phonon backend on Windows (and Mac I think) makes use of the QtOpenGL module. So don't forget to copy this either. It can go inside the application directory.
In any case you could help yourself out a bit by adding a small bit of code that shows (perhaps writes to a file) which mimetypes are available. If it doesn't spit out anything, there is a problem with your backend. (Well, that of your application...)
This is what I had to do when I used Phonon to play video inside my application. Since I only quickly added this some time ago to my application, I'm not 100% sure that this is the only (or even the proper) way to do this, so anyone who has different insights feel free to comment on this.