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 - TheEnigmist

Pages: [1] 2
1
General discussions / Visual Studio 2012 RC
« on: June 02, 2012, 01:39:41 pm »
I see that M$ releases VS2012! Now i've some question about:
How much of you use VS2012 RC? :)
How is C++11 support?
Can i still use sfml2 under VS2012?

2
Graphics / VertexArray for tilemap
« on: May 31, 2012, 12:13:12 am »
Ok, now i made a functional tilemap, but i foud a limit... cus VertexArray is a std::vector<Vertex> i can't make a 3900x3900 tile map (60 milion of vertex)
Due to private member i can't know m_vertices.max_size()
For the moment i can generate and build a 32x32*256px tilemap in some microseconds and draw it in 10 microseconds :)
My question, how can i know the max size of m_vertices?

For the moment i get crash at this line:
myMap.resize(nrows*ncols*4);
 

EDIT:
Ok i see that i will get some FPS crash with 350x350 map. So i suppose to set max map size to 300x300 which is the last stable FPS map size!

3
Graphics / Question about RenderTexture
« on: May 29, 2012, 10:05:38 pm »
I have some question about RenderTexture. I'm making a tilemap. Each tile is 256x256 px and i want to test if i can handle huge map (3900x3900). First time i used a vector and there was a very bad way. Now i've switched to RenderTexture and i draw each tile into it. The problem is one... 3900x3900 or a little example (100x100) isn't possible due to RenderTexture::create() limit. It say me i can create max 8192x8192 px texture (32x32 tile map). Now i have these questions:
1) Is max texture size same in all GPUs or is it a MY GPU limit?
2) To manage bigger map, will it be a good idea to create a vector<RenderTexture> each 32x32?

4
General / setFramerateLimit doesn't work
« on: May 27, 2012, 05:05:59 pm »
I've found this problem in my SFML2 RC... i'm using this code for test it:
int main(){
        sf::RenderWindow window(sf::VideoMode(1024,768,32),"FPS: ");
        window.setFramerateLimit(500);
        //window.setVerticalSyncEnabled(true);
        while (window.isOpen()){
                window.setTitle("FPS: "+GetFrameRate());
                sf::Event events;
                while (window.pollEvent(events)){
                        if (events.type == sf::Event::KeyPressed && events.key.code == sf::Keyboard::Escape)
                                window.close();
                }

                window.clear(sf::Color::Blue);
                window.display();
        }
        return EXIT_SUCCESS;
}
With VSync ON FPS are 59~61.
With or without setFramerateLimit(500) FPS are 980~991
 

5
System / Question about sf::Clock
« on: April 12, 2012, 11:23:10 pm »
Simple and fast:
There is a way to pause sf::Clock?

6
Audio / No sound inside custom class
« on: March 18, 2012, 10:52:59 pm »
I have some problem with my weapon class to fire when it's costructed.
This is what i made in Weapon constructor:
Code: [Select]
Weapon::Weapon(std::string n, const int rate, const int speed):bullets("data/bullets/"+n+"bullet.png")
{
name=n;
fireRate=rate;
bullets.setSpeed(speed);
buffer.loadFromFile("data/sounds/weapons/"+n+".wav"); //SF BUFFER
weaponSound.setBuffer(buffer); // SF SOUND
weaponSound.play();
}

If i made this in my main:
Code: [Select]
Weapon test("M60",80,1500);
It plays the sound well!
Now, i tested a little weapon vector initializer, so this is what i made:
Code: [Select]
bool loadWeaponList(std::vector<Weapon> &weaponVector){
std::string tempName;
int tempRate, tempSpeed;
std::ifstream weaponFile("data/weapons/weaponlist.txt", std::ios::in);
if (!weaponFile){
std::cerr << "Weapon List File Error!"<<std::endl;
return false;
}
while(!weaponFile.eof()){
weaponFile >> tempName >> tempRate >> tempSpeed;
weaponVector.push_back(Weapon(tempName,tempRate,tempSpeed));
}
return true;
}

The function wroks for bullets and fire, but seems sound doesn't want to start! What can be the error?

7
Graphics / Bug switching PC from 7 to XP
« on: March 10, 2012, 11:26:36 am »
I was building my Hangman game on my main PC (seven) and it work fine! I tested it on my notebook with seven and worked fine too! When i play on XP i see some errors like these:

8
General / ShowMouseCursor deleted in new github!
« on: March 10, 2012, 10:39:17 am »
I see that ShowMouseCursor is not anymore a Window function! I'm looking what changed but i can't find how can i disable cursor in my project!

9
SFML projects / The Hangman
« on: March 10, 2012, 12:02:14 am »
This is my first complete project!
It sux and it is stupid but i learned a lot.
I putted it in sourceforge and maybe i've used a GPL licence on it, but really i don't know how it works :lol:  want to learn about licence and all about a software project.
Btw you can download the game at:
https://sourceforge.net/projects/thehangman/
Controls are into Readme and explained in-game!
It support English and Italian wordlist (800+, 1000+ words)
Hope you will enjoy it!
I'll w8 your comments :)

10
Graphics / Better FPS drawing 10.000 sprite
« on: March 09, 2012, 03:06:00 pm »
I'm testing this code to lern how can i get more FPS. Running it in Release without debugging mode:
Code: [Select]
#include <iostream>
#include <SFML/Graphics.hpp>

int main()
{
sf::Clock clock;
sf::Texture prova;
prova.LoadFromFile("icon.png");
std::vector<sf::Sprite> test;
for (int i=0; i<10000; ++i){
test.push_back(sf::Sprite(prova));
test[i].SetPosition(0.1*i,0.05*i);
}
sf::RenderWindow App(sf::VideoMode(1024,768,32),"Test Test",sf::Style::Close);
App.SetFramerateLimit(300);
sf::RenderTexture renderTest;
clock.Restart();
renderTest.Create(1024,768);
std::cout << clock.GetElapsedTime().AsMilliseconds() << std::endl;
while(App.IsOpen()){
sf::Event events;
while(App.PollEvent(events)){
if (events.Type == sf::Event::KeyPressed && events.Key.Code == sf::Keyboard::Escape)
App.Close();
}
renderTest.Clear(sf::Color::Blue);
clock.Restart();
for (unsigned int i=0; i<test.size(); ++i)
renderTest.Draw(test[i]);
std::cout << clock.GetElapsedTime().AsMilliseconds()<<std::endl;
renderTest.Display();

App.Clear();

// Draw the texture
sf::Sprite sprite(renderTest.GetTexture());
App.Draw(sprite);
App.Display();
}
return EXIT_SUCCESS;
}

Using playclaw/fraps i get 14~19 FPS to draw all item and less than 50ms to draw all 10.000 item into renderTest.
How can i get more FPS drawing all this 10.000 sprites?

11
General / Release Errors
« on: March 08, 2012, 11:37:48 pm »
My game work well when run it in debug mode (with and without debugging it) but when i switch to release i get some errors! I work on VS 2010!
Code:
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow App(sf::VideoMode(1024,768,32),"Test TEST tt",sf::Style::Close);
App.SetFramerateLimit(300);
sf::Font TestFont;
//TestFont.LoadFromFile("segoesc.ttf");
while(App.IsOpen()){
sf::Event events;
while(App.PollEvent(events)){
if (events.Type == sf::Event::KeyPressed && events.Key.Code == sf::Keyboard::Escape)
App.Close();
}
App.Clear(sf::Color::Blue);
App.Display();
}
return EXIT_SUCCESS;
}

So i made a little code for testing it and i discovered this:
sf::RenderWindow give this error when has a space into the title:
Quote
Eccezione non gestita a 0x7592feb8 in test.exe: 0xC0000005: Violazione di accesso nella lettura del percorso 0x53455420.

Error pointer:
Code: [Select]
-> sf::RenderWindow App(sf::VideoMode(1024,768,32),"Test TEST tt",sf::Style::Close);
If i put a title like "Test" it works well!
Now the second error. When i try to load a font i get this error:
Quote
Eccezione non gestita a 0x571c37ef (msvcr100d.dll) in test.exe: 0xC0000005: Violazione di accesso nella lettura del percorso 0x2e637365.

Error pointer in fopen.c:
Code: [Select]
-> if(*file==_T('\0'))
        {
            errno=EINVAL;
            return NULL;
        }


How can i fix these errors?

12
Graphics / Alternative to window.Capture()
« on: March 05, 2012, 03:39:20 pm »
I need a good alternative to window.Capture(). This function take 0.5s to take image, i need a faster function to do the same!
I read a topic where laurent said "shader" can do this!
But i can't find a good tutorial or topic that explain how put in image/texture/sprite what i see in window!

13
General / Keyboard.Code problems
« on: March 03, 2012, 08:11:01 pm »
I found a little bug, i don't know if is SFML related or project related, btw i've this simple if:
Code: [Select]
if (events.Type == sf::Event::KeyPressed && (events.Key.Code >= sf::Keyboard::A && events.Key.Code <= sf::Keyboard::Z))
inside this i print in console key's code (for test) and i've discovered that there are 3 non-alphabetic button that activate it!
My keyboard is this:
http://www.mygarage.ro/attachments/teste-si-review-uri/7297d1221598095-review-logitech-cordless-desktop-lx710-laser-hpim1677.jpg
and the 3 buttons are:
    Numpad DEL
    Num Lock
    search button in the middle-up of keyboard

Numpad DEL and Num Lock have 0 as code
search button in the middle-up of keyboard has 2 as code!
There is a way to fix this?

14
General / PollEvent in debugging Visual Studio
« on: March 03, 2012, 03:00:41 pm »
I'm working with VS 2010 and i want to run step-by-step my program so i can manage all problem and find bugs. But i've a problem, in VS i need to press F10/F11 to move one step forward, when my program point to PollEvent() istruction it always get F10/F11 or mouseclick event, i don't know how can i give it all other comands.
My question is simple. There is a guide to use debugging in VS 2010 for SFML projects?

15
Graphics / MouseMoved always true
« on: February 19, 2012, 08:52:27 pm »
I've found that if i use this code somewhere:
Code: [Select]
if (Event.Type == sf::Event::MouseMoved){
std::cout<<"Mouse moved! "<<std::endl;
}

It is always true even if i don't touch mouse. Is it normal?

Pages: [1] 2