C++ :: SDL2 Framework - Loading MBP Files In Same Folder In XCode 5

Feb 23, 2014

I am trying to load a .bmp file located in the same folder as main.cpp etc. but I'm not sure what to input as the resource path so that it picks it up and, when I distribute it, I want it to be preferably cross platform and run smoothly.

I have tried using:

hello_world.bmp
SDL_Game/hello_world.bmp (SDL_Game is the name of the project)

but it will work if I use the full path. I don't want to do this though, because then it will not work on other computers and platforms.

This is the function I use to load media:

bool loadMedia() {
// Loading success flag
bool success = true;

// Load splash image
gHelloWorld = SDL_LoadBMP("hello_world.bmp");

[Code] ....

I am using XCode 5, SDL2.0.1, OSX 10.9 Mavericks and C++.

View 2 Replies


ADVERTISEMENT

C/C++ :: Count Files And Directories In Root Folder With Every Folder Information

Jul 25, 2013

I need a code in c++ . It should count the Files and Directories in root folder with every folder information i need the below information

1) no of files and folder
2) how many files are there in each folder
3) with size of every folder and files it contains

I am new in c++ ....

View 1 Replies View Related

C++ :: Where Is The Path For Header Files For Mac Xcode

May 27, 2013

I want to include turboc.h file for some project

where do i have to add this file for mac xcode?

View 1 Replies View Related

C++ :: Finding Files In A Given Folder?

Jul 23, 2013

I had wanted to make a program that will tell someone how many files there are in a folder and its subfolders with a certain extension. I am not sure how to find the files.

I am using Windows 7.

View 1 Replies View Related

C++ :: Read Files In A Folder?

Jan 2, 2014

I am using dir object from dirent.h to read files of a folder. The code I am using in order to read all data is the following:

vector<string> directories;

DIR *pDIR;
const char * c = path.c_str();
struct dirent *entry;

[Code]....

I am wandering when I am trying to read two times the files of the same folder, it will be stored with the same order or every time I ll read in folder it ll return different file order?

View 1 Replies View Related

C++ :: Rename All Files In A Folder?

May 31, 2013

I want to rename all files in a folder (exactly I want to change extension file example:"FILE0001.CHK" to (FILE0001.JPG)), i know rename function , but how to use it all files, files names going sequencely (FILE0001.CHK,FILE002.CHK until FILE3000.CHK) ... How i can rename or change extension file quickly and easily.

View 1 Replies View Related

C/C++ :: Copying All Files From One Folder Into Another

Mar 27, 2014

I'm trying to make a program that will copy all files from one folder in to another folder.

Ex path:
From: G:ExExF1
To: C:EXAll

I'm using Visual studio express C++ as the IDE. I have tried using this code:

bool copy_functions::CopyAll(string InPath,string OutPath) {
ifstream In(InPath.c_str(),ios::in|ios::binary);
ofstream Out(OutPath.c_str(),ios::out|ios::binary);

[Code] ....

But I always get booth could not be opened for copying messages even thug I use the absolute paths for the folders.

View 5 Replies View Related

C++ :: Loading Menu For Files

Jun 11, 2014

I would like to make a program that automatically launches and loads a file when a file of that file type is double clicked within windows. As said I am unsure where to look for some information as to how to do that, and so turn to you all. Is there a simple way of doing such a thing without using any external libraries, if so, a simple tutorial or link to a reference for this; if there is no way of doing this without externals what would be a small and simple to use library for this?

View 2 Replies View Related

C++ :: Read A Folder That Contains Large Number Of TIFF Files?

May 21, 2014

I want to read a folder that contains large number of tif files. (say 1000 tif images) requirement is to read all files and store in a array/array pointer.

View 1 Replies View Related

C# :: Calling Pictures / Files From A Folder To Show In Screensaver

Jul 4, 2014

How do i go around the code for this screensaver..

[URL] .....

I tried some examples from other people's code but it doesn't seem to work. Tried to ask the owner aswell but it doesn't seem that he would be able to reply as he's been inactive.

View 14 Replies View Related

Visual C++ :: Rename Files With Random Names In A Folder

May 30, 2014

I need a code for renaming multiple(bulk or all ) files in a folder.

I found one batch file script but it renaming with numbers only. But i want differntly.

[URL] .....

Example:

In a folder there are 100 images and all numbered with some digits or names.

assume that all images are belongs to "john" , so i want to rename all images with "john+ a random string".

here a random string means -> it has an array with 3000 english words, (you can predefine them by downloading from dictonary).

In the script the 3000 names are fixed, but the 1st name will be changed by my wish. that my be john, mary, sai, pavan etc...

Suggestion: you do not need to enter all 3000 words in array manually. some javscript codes are there to read input of each and evey line and them into an array.

View 2 Replies View Related

C# :: Loading Large Text Files In A RichTextBox (OutOfMemoryException)

Mar 31, 2014

I am creating a simple log parser (loads a text file and filters out unnecessary information, but has the option to show the full log) and I'm running into an issue with fairly large log sizes (50+mgs). I have seen a few recommendations from a stream to memory manged files and even alternate 3rd party controls.

I foresee a few issues with any of the non-third party solutions (which I would prefer to avoid third-party add-ins) such as the scroll bar not correctly reporting the relative length or position of the complete text in the box (when displaying only a portion of the file at a time) and in the stream solution where you read on scroll (as necessary) have not only the same issues, but how do you resume reading in the middle of the file? This also all assumes I would be periodically clearing the RichTextBox to keep the memory usage down to avoid an OutOfMemoryException (which I have been running into.)

View 14 Replies View Related

C++ :: SDL2 - Getting Pixel Value

Nov 5, 2013

I use SDL2. and i was testing some functions i took from some internet and some unwanted results happened.

Code :

Pixel *GetPixel(SDL_Surface *surface, int x, int y) {
Uint8 p8, *buf8;
Uint16 p16, *buf16;
Uint32 p32, *buf32;
switch(surface->format->BitsPerPixel {

[Code] .....

And the output changes time to time.

View 3 Replies View Related

C++ ::  SDL2 / Player Not Moving Constantly

Feb 16, 2015

Im using SDL2 but I'm encountering an unexpected error. I have implemented the same method to move as in my old Projects, but the Player appears to be stuck...

The Player is stuck for maybe half a second, and then everything works as it should, but every time I Change direction or i start moving the Player is stuck for a short Moment.

#ifndef _PLAYER_HPP_
#define _PLAYER_HPP_
#include <iostream>
#include <string>
#include "SDLGameObject.hpp"
class CPlayer : public CSDLGameObject

[code]....

View 9 Replies View Related

C++ :: SDL2 Programs Stop Responding

Apr 30, 2014

This is a problem I have been having with every program I write since I started using SDL 2. Whenever I compile my code and run my program, everything works perfectly fine until at some point (usually after 3-8 minutes of running), the program will stop responding completely and I will have to exit out of the console to close it. The code I believe is relevant is:

void MainLoop()
{
InitLoop();
while ( !QuitMain )

[Code].....

If I change SDL_PollEvent(&Event) to SDL_WaitEventTimeout(&Event,100), then the problem goes away (I did that and had the program running for about an hour without it stop responding before I decided that it solved the problem), so I believe that the problem has something to do with event handling. Also, it might be noteworthy to mention that when I use SDL_WaitEventTimeout with the second parameter being a small number (because 100 milliseconds is a long time to wait and makes the program run at like 8 FPS), the problem returns.

View 2 Replies View Related

C++ :: Sdl2 Copy And Paste Fallback Renderer

Jul 16, 2014

Well if you don't know, there are multiple renderers in sdl, and on some don't work on certain computers, so people use a fallback ex: "accelerated renderer -> software renderer". Sadly, I haven't came across an example that I could copy and paste.

View 16 Replies View Related

C++ :: Xcode 4 Not Compiling?

Mar 20, 2012

I'm taking an intro to c++ class and during an exercise I ran into multiple errors that are out of my knowledge to fix. The rest of the class is using Visual and that is all the instructor knows so i'm in my own figuring out Xcode. Basically I wrote the same program twice but one has a different struct and I get all sorts of errors with it. understand what the errors are and why they occurred.

The working program is this:

#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
struct point {
public:
double x1,y1;
double x2,y2;

[code]....

This program does not compile and I get the following errors:

stl_iterator_base_types.h

1) Symantic Issue
No type named 'value_type' in 'myPoint'
2) Symantic Issue
No type named 'iterator_category in 'myPoint'
3) Symantic Issue
No type named 'difference_type' in 'myPoint'
4) Symantic Issue
No type named 'pointer' in 'myPoint'
5) Symantic Issue
No type named 'reference' in 'myPoint'

Why does one work and the other doesn't!?

View 14 Replies View Related

C :: Expandable Menu Framework

Mar 8, 2014

I'm new to C programming and I need to write a "small" expandable menu framework and I don't know where to start off.

This is my task: Create an expandable menu framework in C where you can add a infinite number of entries and Sub menus containing other Menu points or where the entries refer to a external function. So far I've created the structures I need

Code:
//Menu structure
struct menu {
char mtitel[MAX];
struct mpoint point;
struct menu *next, *prev;

[Code] .....

View 2 Replies View Related

C :: How To Create A Library Using Xcode

Feb 2, 2013

I'm completely new to C, and I don't know how to create a library using Xcode.

View 5 Replies View Related

C/C++ :: Reading From A File In Xcode

Mar 18, 2014

typedef struct dvdtype{
int dvdcode;
char title[50];
int customerID;

[Code]....

i am trying to write this program about a dvd club...i have functions that insert,delete,rent,print movies..I also have to make 2 other functions..Save to file and load from file..My function for saving to file is exactly the same as the one i posted except instead of "r" i put "w" and fprintf for fscanf and fgets..So my function for saving works ok...(in xcode i have to use the full path of a file) but this one does not work...If i call the function from the main menu it does not print Error neither does it say that there is something else wrong...When i gave the number 6 for example to call the function,afterwards it is like the program is waiting for me to give number or characters..it is like using scanf...I write anything and press enter and nothing happens ,it is like asking for data again..i give some numbers or letters and press enter for 5 or 4 times and it displays the menu and asks to choose what to do again, as if nothing happened ,without printing the values that are inside the file..

View 14 Replies View Related

C/C++ :: Access C-library Using Xcode?

Jan 25, 2014

im having trouble accessing the c library on my mac. The reason being is i need to get the code for pi for my program.

View 1 Replies View Related

C++ :: How To Get TinyXML In SDL Based Framework To Render Map

Jan 10, 2015

To the topic: I've been following "SDL game development" book by Shaun Mitchell and (besides the many others in the past) I've encountered a problem in one of the chapters.

I'm in "creating and displaying tile maps". The chapter uses tintxml to load data outside the code, which is used to create a "map screen".

The problem is that the program work perfect except for not loading and/or rendering this "screen".

I know this is too vague of an explanation, but I wouldn't know what else to say.

I'm leaving the link to the repository with all the code: [URL]...

View 12 Replies View Related

C/C++ :: Running Multiple Terminal In Xcode

Oct 5, 2014

I am using Xcode to do c++ programming and I have a c++ code, with different input arguments. I want to achieve that in Xcode, I could run multiple simultaneous running of my c++ code. However, the current problem is that once one code finishes, its terminal window automatically closed and I do not have time to look at its result. Thus computer time is wasted. Is there a way to run multiple same c++ code with different arguments input?

View 6 Replies View Related

C/C++ :: Linking Boost Thread With Xcode

Sep 30, 2014

I have built Boost from the website using

./bootstrap.sh
./b2 install

I think all are installed properly. I am trying to use Xcode to include the library of boost:thread.My code links to the header file properly with " #include "boost/thread.hpp"" commented, as seen from the following:

However, it could not link properly to boost-thread if "#include "boost/thread.hpp"" is un-commented.

Error page is shown as:

I have linked the dynamic library libboost_thread.a and libboost_thread.dylib and included /usr/local/include into header search path and /usr/local/lib into library search path.

View 1 Replies View Related

C# :: Cascading Deletes In Entity Framework Code First

Apr 15, 2015

I'm a bit unsure on where to put cascading deletes in my models and how far they extend.

I've got four tables

TrafficLog
has a One to One with
TransactionHistory
Has a zero to Many with
OutgoingService
and
Exceptions

Now i'd like to put cascading deletes on, so that if i delete a record from TrafficLog it deletes from the other three.

So do i set up my model with cascade delete just on the primary like this

modelBuilder.Entity<TCC_ArchivedApplicationTrafficLog>()
.HasRequired(TCC_ArchivedTransactionHistory)
.WithRequiredDependent()
.WillCascadeOnDelete(true);

or do i need to enable it on the other three tables too?

View 3 Replies View Related

Software :: Xcode Command Line Tool?

Mar 12, 2015

using cs50 videos. I'm working on writing a caesar cipher program(pset2) in c using Xcode and the command line tool. So far I just press play and it compiles and runs my source code. Now I need to use command line arguments, how do I enter command line arguments with the tools I'm using?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved