Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Raptor88

Pages: [1] 2 3 ... 8
1
However, looking at your Nightly Builds, it lists versions for Visual C++ 10 and 11.  What do the 10 and 11 signify?
The Visual Studio get a name with the year number where the versiin number slowly increases. With VS 2010 they got lucky and the year and version number matches, but with VS 2012 the version is 11, thus VC10 and VC11. ;)

Thanks for that info.  Might be a good thing to explain that the 11 indicates VS 2012 on your webpage.  Folks who don't know that (like me) wouldn't download the 11 version for VS 2012.

Happy Holidays,
Raptor

2
General / Re: MS Visual C++ Express 2010 with SFML 2.0 and Windows 8
« on: December 04, 2012, 02:07:35 am »
Visual Studio 2010 and 2012 work perfectly fine on Windows 8. ;)

There aren't any official builds for VS10 though, so you'd have to build it on your own, or use my Nightly Builds. ;)

If Visual Studio C++ Express 2010 works fine in Windows 8, then that will be fine for my needs.

However, looking at your Nightly Builds, it lists versions for Visual C++ 10 and 11.  What do the 10 and 11 signify?

Thanks,
Raptor

3
General / MS Visual C++ Express 2010 with SFML 2.0 and Windows 8
« on: December 04, 2012, 12:25:36 am »
Has anyone got MS Visual C++ Express 2010 working with SFML 2.0 in Windows 8?

If the 2010 version of VC++ won't work in Win8, are there pre-compiled modules for SFML 2.0 which will work with MS Visual C++ Express 2012 in Windows 8?

I'm thinking of installing Windows 8 in place of Vista on my laptop so thanks for any help on this,
Raptor

4
General / Re: Handling loading of images
« on: November 19, 2012, 09:49:10 am »
Thanks for your input mateandmetal.  Very interesting recommendations for further research.

Raptor

5
General / Re: Handling loading of images
« on: November 17, 2012, 12:29:08 am »
Hi eXpl0it3r,

Thanks for your input.  Helps to get different points of view in how program a SFML game.

Raptor

6
General / Handling loading of images
« on: November 16, 2012, 09:40:27 pm »
In my crap game, my PrimaryMenu, SubMenus, CrapTable, Chips and Dice will all be PNG images.  I'm thinking that I should load all of the PNG images that I'll use in my program when the program is first opened.  No point in letting the user setup the game and then have the program try load the crap table image when the actual game is started, only to find out then that the crap table image on the hard drive is missing or corrupt.

Do you load all of your images when your program first starts?

If so, how do you store your images so they will be accessible to the different classes when they are needed?  I'm thinking about making a global struct to load all images into.  Is that a good way to do it, or is there a different recommended way?

Thanks,
Raptor


7
General / Re: Is SFML 2.0 compatible with ATI graphics?
« on: November 12, 2012, 11:17:33 pm »
Yes, as far as I know there's no major problem with SFML 2.

Very comforting to know.  Thanks Laurent!

Raptor

8
General / Is SFML 2.0 compatible with ATI graphics?
« on: November 12, 2012, 11:41:26 am »
I know programs using SFML 1.6 can have problems with ATI graphics.  Is SFML 2.0 compatible with ATI graphics and with all other graphic controllers?

Just wondering,
Raptor

9
General / Re: How many classes in your average SFML program?
« on: November 12, 2012, 06:59:26 am »
You mean the constructor? Or is a static class?

// ***** DisplayError.h *****
#pragma once

#include <string>

class DisplayError
{
    public:
        DisplayError(void);             // Constructor is empty.
        int DispErr(std::string);
};


Quote
Ah right, so am I right in assuming you basically have this:
Code: [Select]
// loader.cpp
void loadStuff(){
  sf::Image img;
  bool success = img.loadFromFile("somejunk.png");
  if (!success){
    ShowError("Can't load file somejunk.png"); // ????
  }
}
If so... then this looks bad, and it will be tricky to trace the execution of the program. A better approach would be to either return an error code or struct, or to throw an exception. Then at the top level (e.g., in main.cpp) you grab the error, create the error window, etc. This also has the benefit that you loadStuff() etc. don't need to know about ShowError() anymore.

Every error string will be unique so I'll know where it came from.  Mainly DisplayError (mistakenly called it ShowError before) is to let the user know why my program has to close.  It's not for my troubleshooting.  I'll definitely keep your suggestions in mind and will use them if I find my current method is tricky to trace.

Thanks much,
Raptor

10
General / Re: How many classes in your average SFML program?
« on: November 12, 2012, 04:23:31 am »
What does ShowError do? If its not an object and its fairly simple then it can just be brought into your main window/UI class. Of course it depends on various things but typically an error message would be a mode of your program. Hence the main class that handles all the UI business might look like:  ... snip ...

Hi eigenbom,

Thanks for showing me some examples of your classes and other data. 

ShowError in my program is a class that takes a string as an argument.  First it closes the game's SFML window and then opens a small SFML window.  Then it displays the string argument (error message) in the small SFML window and waits for the user to either click the close 'X' or press ESC.  Then it returns with a negative value which signals the main loop to exit.

ShowError can be called from any class.  For now, its primary purpose is if "LoadFromFile" cannot find a .PNG image or if the file is corrupt, ShowError is called with the appropriate error message as a string.   I'll be loading stuff from the hard drive for background images, sprites, help info, saved game data, etc.

Raptor

11
General / Re: How many classes in your average SFML program?
« on: November 12, 2012, 01:52:42 am »
You have to be careful that you don't overdo OOP and put everything into classes. Most of your classes have verbs as names, which may be an indicator that they had better be functions. If there is no state, there will usually be no reason for a class.

Hi Nexus,

Guess the SFML website had problems for a while as I couldn't access it.

Looking at my list of classes, should I not create classes for "Display", "RollDice" and "ShowError"?  If I don't create classes for them, would you put them as subroutines in Main.cpp?  All three are used by several different classes.

Regarding the "GetBets" parent and child classes, "GetBets" handles the bets that are always the same when making bets.  "GetBetsComeout" and "GetBetsPoint" inherit from "GetBets" so they can get all of those bets plus get bets unique to the comeout  or point rolls respectively.  The "PayBets" parent and child classes work similarly.  --- Though they are all verbs, would making parent and child classes be the best way to handle them?  If not, how should I handle them?

I assume "Main", "PrimaryMenu", "RTPlay" (RealTimePlay) should definitely be classes.

Thanks,
Raptor

12
General / Re: How many classes in your average SFML program?
« on: November 11, 2012, 07:30:29 am »
Don't feel too bad I'm still beating my head against the wall on an objectmanager class.

 :) :) :)

 Raptor

13
General / Re: How many classes in your average SFML program?
« on: November 10, 2012, 10:02:27 pm »
It depends on what you're doing, some games are more complex than others. Mine has around twice the amount of classes yours has and I am not even near half of what I need to have. Smaller games need less code, as simple as that. There are of course classes that all games must have, such as a holder for textures and/or images, a game state manager, main menu, movable object base class and many such.

I don't know what happened but I must have pressed a wrong key while typing and things got hung up.  I had not clicked "Post" to post my initial post yet, but when I checked just now, I saw my text had been posted but the list of classes was incomplete.  So I added the rest of the classes I have so far to my list.

From your response, I guess the amount of classes I have so far is probably OK.

Programming in "C++" with all the classes seems to be a lot harder than programming in "C" many years ago.  Composing in C++ needs so much tabbing between different files.  (I'm using Visual C++ 2010 Express)

Thanks,
Raptor

14
General / How many classes in your average SFML program?
« on: November 10, 2012, 08:34:35 pm »
I'm writing my first C++ program and using SFML 2.0.  I'm wondering how many classes does a typical SFML program contain?  I know it depends on how simple or complex the program is so here's a list of classes I think my craps game program will contain:

Main.cpp
Display.h,  Display.cpp
PrimaryMenu.h,  Primary Menu.cpp
RealtimePlay.h,  RealtimePlay.cpp

GetBets.h,  GetBets.cpp  (parent class)
...GetBetsComeout.h,  GetBetsComeout.cpp (child class)
...GetBetsPoint.h,  GetBetsPoint.cpp  (child class)

PayBets.h,  PayBets.cpp (parent class)
...PayBetsComeout.h, PayBetsComeout.cpp (child class)
...PayBetsPoint.h,  PayBetsPoint.cpp  (child class)

RollDice.h,  RollDice.cpp
ShowError.h,  ShowError.cpp  (shows "file not found" or other errors in SFML window)
 

15
General / Re: How do i write variables contents in text?
« on: October 26, 2012, 12:30:14 am »
A small tip. The stringstream object doesn't clean it's buffer on it's own, if you concatenate one thing and need to concatenate something else you'll have to reset the string within.

Thanks masskiller.  Although directed to Assassinbeast, I didn't know that either.

Hmmm, I didn't see how text could be combined with a variable using exploiter's code as posted.
Maybe obvious to experienced programmers but not so much to us newbies.  ;)
sf::Text text;
int a = 45;
float b = 3.4f;
std::string c = "Hello";

text.setString(toString(a) + toString(b) + c);

Very neat and tidy.  Thanks for posting that code and clarifying eXpl0it3r.

Raptor

Pages: [1] 2 3 ... 8