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

Pages: 1 ... 9 10 [11] 12 13 ... 16
151
SFML projects / Re: Screenshot Thread
« on: April 27, 2016, 08:58:13 pm »
Wanted to make a grass... A good grass. Awesome grass. And it's almost done. Class for grass blade... Each has own "bones", color, angle... And here it is. And with animation it looks much greater

152
Feature requests / Re: More Events
« on: April 20, 2016, 09:32:17 am »
Sorry about the hotkeys... It can be done simply by checking sf::Keyboard::isKeyPressed. But dropping files is a nice idea. At least it can be easily done for windows. Just change 'CreateWindowW' to 'CreateWindowExW' and add WS_EX_ACCEPTFILES as first param and on event fill std::vector<sf::String> with filenames. But for X - it is horrible  :D I spent two days to find out, how does Xdnd work and still can't get it...

153
Feature requests / Re: More Events
« on: April 18, 2016, 05:53:31 pm »
Hiura, I know that it's too low-level... For now I'm writing timer for speedruns (http://en.sfml-dev.org/forums/index.php?topic=20182) and I want to make HotKey support to control timers without moving focus to timer window and I want to change profiles just by Drag&Drop profile files to application window.

Yeah, maybe easiest way to do it will be to fork repo and make changes for my own...

155
Feature requests / Re: More Events
« on: April 18, 2016, 02:03:36 pm »
Laurent, for example WM_HOTKEY. I can register hotkey with 'BOOL WINAPI RegisterHotKey', but can't get event. Or file drops (as was requested in http://en.sfml-dev.org/forums/index.php?topic=19096.0).

Yes, realization of functionality like that is kinda difficult. But what about to make just OS-specific event data and OS-specific event?

For example: there's a 'processEvent' function in window implementation.

    switch (message)
    {
....
        case WM_CLOSE:
        {
            Event event;
            event.type = Event::Closed;
            pushEvent(event);
            break;
        }
.....
        default:
        {
            Event event;
            event.type = Event::OSSpecific;
            event.data.message = message;
            event.data.wParam = wParam;
            event.data.lParam = lParam;
            pushEvent(event);
            break;
        }
 

Of course with X11, Android etc. there will be another data structures, that can be ruled by #ifdef's.

156
Feature requests / More Events
« on: April 18, 2016, 01:39:26 pm »
What about to add some more events? For example: DROPFILES and HOTKEY.

157
SFML projects / Timer for speedruns "Stopwatch"
« on: April 18, 2016, 12:02:09 am »
Made it just for one day  :D Coding speedrun  ;D

Well, after browsing web for a good speedrun timer didn't find anything nice for linux and decided to write my own.

More detailed description can be found here: https://github.com/achpile/asplit/releases/tag/v1.0-rc1


158
Feature requests / Re: sf::Rect extension
« on: January 26, 2016, 08:29:28 am »
It is cannot be done, ShqrdX, because there can be no + or / operators defined for class T

159
Feature requests / Re: sf::Rect extension
« on: January 25, 2016, 11:54:16 am »
Wow, nice to see my suggestion going to be part of SFML  ;) Thanks Tank!

160
Window / Re: Joystick axes
« on: April 21, 2015, 11:27:52 pm »
You might want to try calibrating it.

Thanks a lot, Binary1248! It helps =) First time I had no success and bug came again after joystick reconnect, but after I find out about 'jscal-store' and now everything's great :D

161
Window / Re: Joystick axes
« on: April 21, 2015, 10:56:07 pm »
Huh.. Seems to be a driver problem. It's at initial state:

achpile@linux:~$ hexdump /dev/input/js0 -C
00000000  4c 2f 31 00 00 00 81 00  4c 2f 31 00 00 00 81 01  |L/1.....L/1.....|
00000010  4c 2f 31 00 00 00 81 02  4c 2f 31 00 00 00 81 03  |L/1.....L/1.....|
00000020  4c 2f 31 00 00 00 81 04  4c 2f 31 00 00 00 81 05  |L/1.....L/1.....|
00000030  4c 2f 31 00 00 00 81 06  4c 2f 31 00 00 00 81 07  |L/1.....L/1.....|
00000040  4c 2f 31 00 00 00 81 08  4c 2f 31 00 00 00 81 09  |L/1.....L/1.....|
00000050  4c 2f 31 00 01 80 82 00  4c 2f 31 00 01 80 82 01  |L/1.....L/1.....|
 

So each 16 bytes is 1 event. 81 is initial button event, 82 is initial axis event (0x80 | 0x02). First 4 bytes is timestamp, next 2 bytes - value. So initial values for axes is "01 80" = 0x8001 = -32767 as signed int16

162
Window / Re: Joystick axes
« on: April 21, 2015, 10:46:55 am »
Did you try the master revision of SFML? Joystick detection was rewritten a month ago.

Thanks, I'll try it out at home ;) Forget to mention that I used SFML v2.2 release sources.

163
Window / Joystick axes
« on: April 21, 2015, 10:07:06 am »
This is the strangest thing I ever seen. I have a joystick "EXEQ Spitfire" and tested it on 4 different systems:

  • Linux 32bit laptop ASUS X200CA
  • Linux 64bit (Ubuntu 14.10) at home
  • WinXP 32bit at home
  • Linux 64bit (Ubuntu 14.10) at work

All the linux systems throw me two messages to console:
Unable to get joystick attribute. Could not find USB device for joystick at index 0.
Unable to get joystick attribute. Could not find USB device for joystick at index 0.
 

This code:
printf("[%u : %u] %s\n", sf::Joystick::getIdentification(0).vendorId,
    sf::Joystick::getIdentification(0).productId,
    sf::Joystick::getIdentification(0).name.toAnsiString().c_str());
 

Gives me:
[0 : 0] Microntek              USB Joystick
 

Well, about the problem:

Linux 64bit (Ubuntu 14.10) at work works properly.

WinXP 32bit at home gives me (-0.78, -0.78) on X and Y axes when nothing is pressed.

Linux 32bit on laptop and Linux 64bit (Ubuntu 14.10) at home got same results on following sequence:
1. I connect joystick
2. Run application
3. Get axes positions (-100, -100) on X and Y
4. Pressing D-pad on X and Y
5. Releasing D-pad and got (0, 0)
6. Run application again
7. Get axes positions (0, 0) on X and Y

So the initial state is wrong.

Can anyone help me, what could be the reason of this strange behavior?  :-\

Tested on this:

#include <SFML/Window.hpp>
#include <stdio.h>
#include <unistd.h>

int main() {
        sf::Window window(sf::VideoMode(800, 600), "My window");

        while (window.isOpen()) {
                sf::Event event;

                while (window.pollEvent(event)) {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                printf("(%3.2f, %3.2f)\n", sf::Joystick::getAxisPosition(0, sf::Joystick::X),
                                           sf::Joystick::getAxisPosition(0, sf::Joystick::Y));
        }
        return 0;
}
 

gcc main.cpp -o test -lsfml-window -lsfml-system -lstdc++

164
SFML projects / Re: Witch Blast (dungeon crawl shooter)
« on: April 15, 2015, 09:42:38 am »
Wow!!! Big rooms!!! And the art... it... is... AMAZING!!!!! Cirrus Minor, you've made a great job!!!!! And it's a great pleasure to see, how's your project growing up!!! And a great pleasure for me to be a part of it as a russian translator ;)

165
Feature requests / sf::RectangleShape(sf::FloatRect) constructor
« on: April 14, 2015, 07:36:44 pm »
I think it will be useful to make a RectangleShape constructor with FloatRect argument ;)

position = sf::Vector2f(left, top);
size = sf::Vector2f(width, height);

Pages: 1 ... 9 10 [11] 12 13 ... 16