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

Pages: 1 [2] 3
16
General discussions / Re: SFML Game Jam
« on: July 20, 2013, 04:32:38 am »
Time:
The jam will start midday(some time) August 2nd  and end 72 hours later on August 4th
Meep.

Oh well, I'd prefer this anyways.

17
Added a new version which shows up correctly for the new header. Also fixed the bug where it goes to the front page of the forums as well as the documentation when you press enter.

18
SFML projects / Re: QuickSnap - Screenshot program
« on: November 05, 2012, 05:30:53 pm »
Uploaded a new version which fixes an issue with washed-out images on some computers.

19
SFML projects / Re: QuickSnap - Screenshot program
« on: October 28, 2012, 01:10:44 am »
main.cpp, line 10:
Where did you get those numbers from?!?! Hex editor?
At one point Laurent had posted a code snippet that would dump a file like that. It had a few issues though, at least for me (sometimes it printed 3 extra bytes for a single 0x, which made a bunch of warnings :P), so I had to tweak it some.

Here's the tweaked code: http://pastebin.com/tZYQfeCS

20
SFML projects / Re: QuickSnap - Screenshot program
« on: October 27, 2012, 04:36:06 pm »
Added the source code here.

I didn't end up actually cleaning it up much, just organizing it into multiple files. :P

21
SFML projects / Re: QuickSnap - Screenshot program
« on: October 26, 2012, 04:47:48 pm »
Never heard of Microsoft's program. :P

At the moment SFML is used for for the global keyboard shortcuts (sf::Keyboard), opening the windows (and drawing on them), and saving the screenshot (sf::Image).

Currently, the windows API is used for:
  • Moving the window to a position - with multiple monitors, the origin isn't always (0, 0). (Just now realized sf::Window has a function for that...)
  • Making the window transparent - I copied some code from a recent forum post around here, which didn't work at first (like they said), but it fixed itself by the time I made the window across both monitors.
  • Forcing a window to always stay on top, and to have focus.
  • Getting the screen origin (see first item :P) and size, for multiple monitor support.
  • Getting the actual snapshot, and putting it in the clipboard.

I think Laurent has some of these (ie. multiple monitor support) planned, but I thought I saw at one point other things probably wouldn't happen (transparent windows, clipboard).

It should be fairly easy to port though, since I have everything OS-specific in separate functions.

22
SFML projects / QuickSnap - Screenshot program
« on: October 25, 2012, 06:17:29 pm »
(Not sure if anything else uses that name. It was the first thing I thought of. :P)

This is just a quick little tool to take screenshots. An IM program called Trillian allows me to directly paste an image from my clipboard into chat. I got tired doing this every time I wanted to screenshot something:

  • PrintScreen
  • G2 (I have a Logitech G19, I set this key to open MS-Paint)
  • Find the newly-opened Paint window
  • Ctrl+V
  • Crop
  • Ctrl+A
  • Ctrl+C

So, I made this. :) It works with multiple monitors (or at least, two same-sized monitors).

Starting the program appears to do nothing. Instead, it needs to be activated by a key combination:

Pressing Ctrl+PAGE_UP will lighten the entire screen, and a small black circle will follow your mouse. Now, click and drag, and a black rectangle will show the selection area. If you aren't happy with that rectangle, you can choose another. Once you've chosen an area, press enter. The white area and black rectangle should disappear, and the new screenshot will appear in your clipboard. It is also saved to "%APPDATA%/quicksnap".

If you want to close it for some reason, press Ctrl+PAGE_DOWN. A window should show up like this:



Pressing the red "No" button will let it continue running, and pressing the green "Yes" button will close it. Once it is closed, you can't do Ctrl+PAGE_UP anymore.

If you hadn't guessed by the "%APPDATA%" comment earlier, it's Windows-only (although it should be fairly easy to port). It would probably work great as a startup program though!

Download
Version 0.1.1: Download
Version 0.1.0: Download

The source code is here.

Changelog
Quote
[10/25/2012] Initial Release
[11/5/2012] Fixed issue with images being washed out on some computers.

23
Uploaded a new one that adds a documentation "search" area in the top right corner:



It can take a module name (like "network" or "audio", case insensitive) or a class name with or without "sf::" (case sensitive, since page URLs are case sensitive).

I also added a few variables to the top that lets you change the documentation version (DOC_VERSION) and placeholder search text (SEARCH_TEXT), disable opening in new tabs (NEW_TAB), and disable the link or search box (LINK or SEARCH, respectively) individually.

24
This adds a "DOCS" link to the navigation bar leading to the SFML 2.0 2.4..2 class list (in a new tab).

(10/21/2012: Added search box)
(05/07/2013: Fixed for new forum header, fixed bug with going to main forum page on form submit.)
(05/09/2017: Fixed for https and changed docs version to 2.4.2)

I just thought other people might find it useful. :P

(Old version for slightly larger search box here.)
(Old version for old forum header here.)
(Old version with just the link here.)

25
General / SFML Port Problem: Textures Not Displayed
« on: April 15, 2012, 09:19:00 pm »
I've been sporadically working on an SFML port for a while, and I almost have every module (except audio) working. The main problem is that the graphics module won't work with textures.

#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
        std::streambuf* coutBuf = std::cout.rdbuf();
        std::streambuf* errBuf = sf::err().rdbuf();
        sf::err().rdbuf( coutBuf );
       
        sf::RenderWindow window( sf::VideoMode( 320, 240, 24 ),"Window" );
        window.setFramerateLimit( 1 );
       
        sf::Font font;
        std::cout << "Loading \"resources/sansation.ttf\"... " << ( font.loadFromFile("resources/sansation.ttf") ? "Success" : "Failure" ) << std::endl;

        sf::Texture tex;
        std::cout << "Loading \"resources/image.png\"... " << ( tex.loadFromFile( "resources/image.png" ) ? "Success" : "Failure" ) << std::endl;
       
        std::cout<<"SC\n\n";
        sf::Text text( "String", font, 20.f );
        std::cout<<"MC\n\n";
        sf::Sprite spr;
        spr.setTexture( tex, true );
        spr.setPosition( sf::Vector2f( 100, 100 ) );
        std::cout << "EC\n\n";
       
        while ( window.isOpen() )
        {
                sf::Event event;
                while ( window.pollEvent( event ) )
                {
                        if ( event.type == sf::Event::Closed )
                        {
                                window.close();
                        }
                        else if ( event.type == sf::Event::KeyPressed )
                        {
                                std::cout << "Key pressed" << std::endl;
                                if ( event.key.code == sf::Keyboard::Menu )
                                {
                                        window.close();
                                }
                        }
                }
               
                window.clear();
                window.draw( text );
                window.draw( spr );
                window.display();
        }
       
        std::cout.rdbuf( coutBuf );
        sf::err().rdbuf( errBuf );
}
This works fine on my computer, but on the GP2X Wiz (what I'm porting to), it doesn't.

Whether I use sf::Sprite or sf::Text (or both), nothing gets displayed. If I use sf::Sprite, there is a segmentation fault after the main loop (maybe from sf::Texture?).

sf::*Shape works fine though. :) I haven't tested it with a texture.

The logs (minus a bunch of unrelated stuff):
Code: [Select]
Loading "resources/sansation.ttf"... Success
Loading "resources/image.png"... Success
SC

Failed to create texture, invalid size (0x0)
Failed to create texture, invalid size (0x0)
Trying to access the pixels of an empty image
MC

EC

Key pressed
Key pressed
Segmentation fault

So, I'm completely lost. :P Any ideas?

EDIT: Oops, forgot to mention the code is here: https://github.com/spacechase0/SFML/tree/wiz

26
SFML projects / Re: Tower Defense
« on: March 31, 2012, 03:39:08 pm »
Thanks. :)

I'll probably add it somewhere on my site once I get a few more towers implemented.

Updated the images in the first post. It has tower selection/upgrading, and enemy health bars.

27
SFML projects / Tower Defense
« on: March 30, 2012, 10:55:26 pm »
Since it's "technically" in a playable state now, I thought I'd go ahead and post this. :P

I've been working on this for a little over a week and a half. I've been using SFML and SFGUI, and once it's further along, I might use Thor for particles.


The black rotating squares are damage-over-time effects.

Obviously it still has a long way to go. Here's a couple of the things I want to do:
  • More levels/enemies/towers/traps (traps not implemented yet)
  • Highscores (online?)
  • Map Editor
  • Ability to record and watch a level.
  • More!

I have no idea what I'll do with it once I finish. :P

Download (0.08):
Windows
I'll add Linux/Mac once it's more playable.

Website: Tower Defense

28
General discussions / SFML 2 for OS X comes true!
« on: December 12, 2010, 01:05:12 am »
Just made a quick (and very sloppy) project template for graphic applications here . I just put it in "/Developer/Library/Xcode/Project Templates/Application" and it worked fine.

29
Network / sf::SocketTCP::SetBlocking Causes Memory Usage to Skyrocket
« on: April 17, 2010, 03:11:41 pm »
I tried making it not a pointer, but that didn't fix it. :(

30
Network / sf::SocketTCP::SetBlocking Causes Memory Usage to Skyrocket
« on: April 14, 2010, 07:57:05 pm »
Quote from: "Laurent"
Do you use the debug libraries in debug mode?

Yes.

Quote from: "Laurent"
Quote
It still goes up, and when I try to run the executable without going through Code::Blocks (like double clicking the EXE) it says it can't find libgcc_s_dw2-1.dll (like last time I tried to upgrade) (although this time I did try to upgrade the compiler).

Add -static-libgcc to the linker options.

Thanks! :D

Pages: 1 [2] 3