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.


Topics - Wander

Pages: [1] 2 3
1
General / Linking Error
« on: August 07, 2011, 11:51:48 am »
I am trying to get SFML working in VS2008 Express but I keep getting linking errors.

I have tried the release version of the libraries, the debug, and the -s... whatever that is. I always get the same thing.

Quote
The procedure entry point ??0Image@sf@@QAE@XZ could not be located in the dynamic link library sfml-graphics.dll.


I found lots of these on the forum but all of the solutions that were in those posts haven't worked for me.

EDIT: I have SFML_DYNAMIC in the preprocessor options.

2
Graphics / Question on Gifs
« on: July 24, 2011, 08:10:03 am »
Does SFML currently support gifs?

3
Window / Stopping View Scrolling
« on: July 10, 2011, 08:19:03 am »
I am attempting to make the view scroll while the user has their mouse on the right or left side of the window. It is scrolling over and image and I need it to automatically stop when it reaches the edge of the image.

I have a tried few methods, but none have worked out.

[list=1]1. I have tried putting a line of black of pixels along the first and last columns. I then had the program look at the current pixels that the mouse is over and look for the black pixels, but as there has to be a margin area for the mouse to scroll with that didn't work.

2. I put another line of pixels at the edge of the scrolling margin but that didn't work out as planned either.

3. I have tried just sensing the black surrounding the image, but that isn't part of the image, so I can't sense it for a color.[/list:o]

I can think of only one more method, but I have no idea how to implement it.

-Somehow have the computer know where the view is on the image.
    The only trouble I have with this is that the Offset for scrolling is 100f * the frame rate. I assume that will make the frame rate vary from computer to computer, so I can't count using that. Correct if I'm mistaken.

Don't know if this will help but:
The window is 1280x720.
The image is 3840x720 (3x the window length).

4
General / GUI
« on: February 10, 2011, 11:57:19 pm »
I need to find a really good GUI to use for my programs. :) Any suggestio0ns?

5
Audio / Music Slicing
« on: February 08, 2011, 05:37:07 am »
I've been trying to figure out a way to remove lyrics from a song. Anyone got any ideas?

6
Graphics / Point Finder
« on: February 03, 2011, 06:13:01 am »
I've been thinking about this for about 3 days now, but I can't seem to figure out how I'm going to accomplish this task.

What I want to do is create a function that will be able to find a specific point on an sf::Shape and jump straight to it.
In other words, I can type in any coordinate that is on the map and it will find it and take me to it.

Any ideas would be great. :)

7
Graphics / [Solved] This Looks Right to Me, but Obviously Not...
« on: February 02, 2011, 12:30:15 am »
Code: [Select]
#include <iostream>
#include <SFML\Graphics.hpp>
#include "Header\ResourceManager.h"

using namespace std;

int main()
{
    bool Running = true, Shift;
    sf::Shape Map;

    sf::View MainView;

    sf::RenderWindow Window(sf::VideoMode::GetMode(0), "Laz's Interactive Map");

    MainView.SetFromRect(Window.GetDefaultView().GetRect());
    MainView.Zoom(.1f);

    Map.AddPoint(0,0,sf::Color(0,100,0));
    Map.AddPoint(30000,0,sf::Color(0,100,0));
    Map.AddPoint(30000,90000,sf::Color(0,100,0));
    Map.AddPoint(0,90000,sf::Color(0,100,0));
    Map.EnableFill(true);
    Map.EnableOutline(true);
    Map.SetOutlineWidth(100);

    while (Running) {

        float Offset = 20000.f * Window.GetFrameTime();
        if (Window.GetInput().IsKeyDown(sf::Key::Up) && Shift == false)   { cout << "Up" << endl;MainView.Move( 0,      -Offset);}
        if (Window.GetInput().IsKeyDown(sf::Key::Down) && Shift == false)  MainView.Move( 0,      Offset);
        if (Window.GetInput().IsKeyDown(sf::Key::Left))  MainView.Move(-Offset,  0);
        if (Window.GetInput().IsKeyDown(sf::Key::Right)) MainView.Move(Offset,  0);

        if (Window.GetInput().IsKeyDown(sf::Key::LShift)) Shift = true;
        else if (Window.GetInput().IsKeyDown(sf::Key::RShift)) Shift = true;
        else { Shift = false; }

        if (Window.GetInput().IsKeyDown(sf::Key::Up) && Shift == true)   MainView.Zoom(1.005f);
        if (Window.GetInput().IsKeyDown(sf::Key::Down) && Shift == true) MainView.Zoom(0.994f);

        Window.Clear(sf::Color::Red);

        Window.SetView(MainView);
            Window.Draw(Map);
        for (int i = 10000; i < 90000; i += 10000) {
            sf::Shape Line = sf::Shape::Line(0, i, 30000, i, 200, sf::Color::Red);
            Window.Draw(Line);
        }

        Window.Display();
    }

    return 0;
}



This code looks like it should move my view. I set the view by the DefaultView.

8
Graphics / Anyone Know What is Causing This?
« on: January 31, 2011, 07:37:50 am »
I'm sure I'm just doing views wrong, but how would I fix this?



This should be a REALLY large image vertically. It seems to hold a 1:1 ratio along the X-Axis, but as you can see... the Y-Axis has been crushed from 90,000 to what look more like 5,000. ;( *tear*

Here is my minimal code that reproduces the error:
I'm getting good at this! ;D

Code: [Select]
#include <SFML\Graphics.hpp>

int main()
{
    sf::RenderWindow Window(sf::VideoMode::GetMode(0), "Laz's Interactive Map");

    sf::Shape Map;
    Map.AddPoint(0,0,sf::Color(0,100,0));
    Map.AddPoint(30000,0,sf::Color(0,100,0));
    Map.AddPoint(30000,90000,sf::Color(0,100,0));
    Map.AddPoint(0,90000,sf::Color(0,100,0));
    Map.EnableFill(true);
    Map.EnableOutline(false);

    sf::View MainView;
    MainView.SetFromRect(sf::FloatRect(0,0,30000,90000));
    MainView.Zoom(.4f);

    sf::Shape Circle = sf::Shape::Circle(5000,5000,2500,sf::Color::Red, 5, sf::Color::Red);

    while (Window.IsOpened()) {
        Window.Clear();

        Window.SetView(MainView);
            Window.Draw(Map);
            Window.Draw(Circle);

        Window.Display();
    }
    return 0;
}


PS: I'm am 90% sure that this is a View error... I am VERY sketchy in my views... I never know what I'm doing.

Thanks in advance.

9
Graphics / Not Using Threads
« on: January 31, 2011, 03:42:43 am »
Is there a way to make things move around on the screen (such as people) while the user does other things? I don't want to use threads if I don't have to.

10
General / [Solved] Magic Code that Executes In Between Lines
« on: January 15, 2011, 09:23:23 pm »
As you can tell by the title, this error is a nasty one. I have no idea could possibly be causing it. Here is where it is happening:

Problem Area:
Code: [Select]
#include <SFML/Graphics.hpp>
#include "MainMenu.h"
#include "Globals.h"

Player Player1;                          // In between here
TroopManager TrMan;                // And here
ResourceManager ResMan;
TheCorePassage TCP;

int main()


You probably want to see the constructors now:
Player Constructor:
Code: [Select]
Player::Player()
{
    food = 1000;
    foodMax = 2000;
    wood = 500;
    woodMax = 1000;
    stone = 0;
    stoneMax = 0;
    gold = 0;
    goldMax = 0;
    population = 0;
    populationMax = 10;
    populationMaxFinal = 100;
    fame = 0;
    std::cout << "player" <<std::endl;
}


TroopManager Constructor:
Code: [Select]
TroopManager::TroopManager()
{
    std::cout << "troopmanager" << std::endl;
    SlaveID = 0;
    SwordID = 0;
    PikeID = 0;
    ArcherID = 0;
    SpearID = 0;
    CavalryID = 0;
    MastID = 0;
    SetUpgrades();
}


Notice how I put a cout statement at the end of Player and the beginning of TroopManager. I have a member inside of TroopManager that spawns units when activated. Well, that member isn't called until way later in the code. BUT! This program think I'm calling the member in between the object delcarations for Player and TroopManager.

Here is how I know. I put a cout statement inside of the member and it outputs Unit Spawned.

When I ran the program, the console window showed me this:
Quote
player
Unit Spawned
troopmanager


I put the player cout at the end of the constuctor and the troopmanager cout at the beginning of the second constructor. It's calling the uncalled member in between the two lines. D:

Please Help :)

If you need more information just say the word.

EDIT:
Here is what is inside of Globals.h
Globals.h
Code: [Select]
#ifndef GLOBALS_H_INCLUDED
#define GLOBALS_H_INCLUDED

#include "TheCorePassage.h"
#include "ResourceManager.h"
#include "Player.h"
#include "TroopManager.h"

extern Player Player1;
extern TroopManager TrMan;
extern ResourceManager ResMan;
extern TheCorePassage TCP;

#endif // GLOBALS_H_INCLUDED


EDIT:
Quote
It's calling the uncalled member in between the two lines. D:

It's actually not even calling the member... It is just creating a unit out of the blue. I tested it with some more cout statements.

11
Graphics / Dull Image
« on: January 14, 2011, 07:06:51 am »
I have the frameworks of a game up and running. I want to add a menu to the gameplay window though. I want it to pause the game, open up the menu, and dull the background (the gameplay screen) to be tinted black.

The only way I can think it to set a window sized Rectangle to 50% opacity and overlay it on the gameplay screen. Is there a better way of doing this?

12
Window / Fitting Screen Resolution to In-Game Drawables
« on: January 10, 2011, 05:22:34 am »
I need to find a way to make my in-game drawables conform to the screen-resolution or aspect ratio of any computer screen that it runs on.
Right now everything on my menu stays perfectly in place when run on other computer because everything is perfectly centered, but I'd like to start putting things off-center. If anyone has any ideas, please reply. :D Thanks

13
Graphics / [Solved] This Makes No Sense
« on: January 09, 2011, 09:24:55 am »
I created a class that creates buttons for the user and I gave it some members to set the justification and the position.
I have about 6 or so buttons created in the format of a menu and a strange thing is happening with them.

I pose you this question: "Does it make any sense that multiple objects with the EXACT same constructor and argument values, the EXACT same members and argument values, with no value changes of any kind, excluding a single boolean when the object is clicked, between creation and drawing come out different?"

Didn't think so. Well, this is the weirdest thing I've seen in a while.

The menu is divided into a few pages. I'll show you two of them because that's all I have programmed.



Uploaded with ImageShack.us
^ These buttons are actually spot on. They are centered and everything... In fullscreen. I can't get them to center in the window, but when it's in fullscreen they are perfect.


By wander_lazoren at 2011-01-09

^ It says Story Mode on the Options menu because I was testing to see if the length of the string had anything to do with it.
These however, are totally screwed up. The information for the two sections of buttons is exactly the same. I had the console display the numbers and the numbers came out were displayed the same.
I don't know if this is a compiler error or if this is SFML acting up or what.

Every single button had these members used with these arguments.
Code: [Select]
StoryMode.SF_Text.SetFont(TwoForJuan);
StoryMode.SetText("Story Mode");
StoryMode.SetPosition(StartWindow.GetWidth()/2 - StoryMode.WidthHeight.x/2, 347);
StoryMode.SetHighlightColor("YELLOW");
StoryMode.SetButtonColor("WHITE", "WHITE");


Starting after the creation here is exactly what happens in the code until the rendering of the options menu.

1. Wait for event of clicking on a button (Main Menu is displayed)
2. Set Button.Clicked to true.
3. Enter new while loop and event loop.
4. Wait for event of clicking on a button (Options Menu is displayed)
5. Set Button.Clicked to true.
6. Enter new while loop and event loop.
7. This stuff repeats until you either close the window or press the exit button.

Notice that no values were changed excluding the boolean to say when you clicked the button.

14
Graphics / [Solved] Setting Font from Vector
« on: January 08, 2011, 06:25:30 am »
Code: [Select]
sf::Font TwoForJuan;
for (int i = 0; i < rm.FontList.size(); i++)
{
    if (rm.FontList[i].first == "TwoForJuan.ttf"){}
        TwoForJuan.SetFont(rm.FontList[i].second);
}


I need to know how to set a text from a vector. The vector stored a pair of values. The first one is the file name (TwoForJuan.ttf in my case). The second stored the actual font.

It seems to me that there is no SetFont member in sf::Font. If anyone knows a way to perform this task help would be greatly appreciated.[/code]

15
SFML projects / The Core Passage
« on: January 05, 2011, 04:31:17 am »
Two of my friends and I are embarking on an attempt to create a top-down RTS. This RTS will take place in the medieval times. I'm not going to go in details about the background story, but I will be posting ideas, screenshots, and information on what we have done. Feedback will be greatly appreciated. Thanks. :)

Pages: [1] 2 3