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

Pages: [1] 2
1
Graphics / Text wrong display position
« on: January 24, 2018, 08:05:29 pm »
I create simple Text with default null position and why so much offset from Top and Left ??
SFML-2.4.2-vc14-x86
Here example of code and scr >>

win.create(VideoMode(600, 550), "111", Style::Default);
win.setVerticalSyncEnabled(true);

Font font;
font.loadFromFile("Data/arial.ttf");

Event ev;
while (win.isOpen())
{
  while (win.pollEvent(ev))
  {
    if (ev.type == Event::Closed)
      win.close();
  }

  Text txt;
  txt.setFont(font);
  txt.setCharacterSize(65);
  txt.setString("D11");
 
  win.clear(Color(80, 80, 80));
  // Why so much offset ??
  win.draw(txt);
  win.display();
}


2
Window / Window maximize button ?
« on: January 22, 2018, 10:19:44 pm »
How to disable only one maximize button ?


3
Graphics / Text blur - problem
« on: January 21, 2018, 10:38:00 am »
Texture is ok after resized window, but Text no.
How to contrast edges of Text after resize window and stay at same sf::View to window ?





Hmmmm some partical solution to solve - its set x2 bigger Char size and set 0.5f, 0.5f scale.
But some random cut edges >>



Looks like Text only one way to correct display - View to Window 1 to 1 and Text Scale (1, 1);
Or Render text from own Texture.

Or we can draw to RenderTexture, then to Image, then get need pixels and correct all which not equal Color(0,0,0,0) to One color pixel, then draw point to need coordinate to RenderTexture.

Very bad solution because too much pixels at loop need check.
For example if preRender to 32 x 32 area = 1024 iterations. Its for One character.

Very best solution is direct Render Text at One color, but in SFML not have this functionality.
Like in Photoshop - Anti-Aliasing: None >>


4
SFML projects / ReJewel
« on: January 14, 2018, 11:50:37 pm »
Всем любителям тетрисов посвящается.
Создана на C++ и SFML.

ОС: Windows 10 и выше
Жанр: Logic
Разработчик: Redee
Состояние: бета-версия
Необходимые ссылки в видео в описании !!

(click to show/hide)


5
Window / White Window "flash" Screen - Windows 10
« on: July 28, 2017, 05:03:24 pm »
When I create RenderWindow in OS Windows 10 - during some begin frames I see white color Window...
How to avoid this "flash effect", or change default window color while construct ?

6
Window / Cross-platform detect monitor frequency ?
« on: September 26, 2015, 02:22:28 pm »
Detection monitor frequency for Windows / MacOS / Linux ?
Using SFML api how ?

Me need to detect screen frequency before generated window, from OS.

7
System / PhysFS archive stream - more than 4Gb files ?
« on: August 17, 2015, 09:09:15 am »
At PhysFS read function we have >>

PHYSFS_sint64 PHYSFS_read(PHYSFS_File *handle, void *buffer,
                          PHYSFS_uint32 objSize, PHYSFS_uint32 objCount)
{
    FileHandle *fh = (FileHandle *) handle;

    BAIL_IF_MACRO(!fh->forReading, ERR_FILE_ALREADY_OPEN_W, -1);
    BAIL_IF_MACRO(objSize == 0, NULL, 0);
    BAIL_IF_MACRO(objCount == 0, NULL, 0);
    if (fh->buffer != NULL)
        return(doBufferedRead(fh, buffer, objSize, objCount));

    return(fh->funcs->read(fh->opaque, buffer, objSize, objCount));
} /* PHYSFS_read */

At wiki we have >>
https://github.com/SFML/SFML/wiki/Source:-PhysicsFS-Input-Stream
virtual sf::Int64 read(void* data, sf::Int64 size)
{
    if (!isOpen())
        return -1;

    // PHYSFS_read returns the number of 'objects' read or -1 on error.
    // We assume our objects are single bytes and request to read size
    // amount of them.
    return PHYSFS_read(m_File, data, 1, static_cast<PHYSFS_uint32>(size));
}

Ok It say to me - I request read from ZIP archive my 5.5Gb file, but I read only 4Gb (4 294 967 295 bytes) or some wrong size.
How to fix it ??
Any append read functions to buffer ?
And also need for every byte read..

8
Graphics / Visual size of Square ??
« on: July 11, 2015, 03:14:43 pm »
If I create RectangleShape(10.5001f, 10.5001f) - see on monitor square with size of 11px width and 10px height.
Created RenderWindow with size 800x800.

Why not 11px / 11px square.
If I set 10.501f / 10.501f - got square 11 / 11.
But me need 4 signs precision after point.

9
Window / winapi > ClipCursor(..) and window messages
« on: June 27, 2015, 12:42:43 pm »
Why checks m_mouseInside while getting WM_MOUSEMOVE message.
Its message we can get only if mouse cursor under rcClient of window.
And its saying mouse ABOVE render area of window.......
https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L873
And here too > https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L814

Ok I can modify and add variable to simply directly check this...

Maybe its my fault - some reset logic after WM_KILLFOCUS / WM_SETFOCUS....
Need to reenable ClipCursor(..) at >>
https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L583

Yes... ))) Sry for panic )).

Need to do like this >>
case WM_SETFOCUS:
{
        // need to re-clipcursor to save clipcursor to borders of window
        if(mouseOut == false)
        {
                WINDOWINFO wiInfo;
                GetWindowInfo(getSystemHandle(), &wiInfo);
                ClipCursor(&wiInfo.rcClient);
        }

        Event event;
        event.type = Event::GainedFocus;
        pushEvent(event);
        break;
}

10
Window / Possibly issue ??
« on: June 26, 2015, 10:04:08 am »
LOWORD / HIWORD.........
https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L833

Msdn Warning !!! >
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645616%28v=vs.85%29.aspx
Quote
Important  Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.

11
Graphics / Depth bits sfml 2.2 vs 2.3 ?
« on: June 10, 2015, 02:53:18 pm »
Using standart creation window >
RenderWindow wIn(VideoMode(400,200), "MyWin");

If I getSettings().depthBits from RenderWindow object
in 2.3 its - 0
in 2.2 its - 24 (looks like correctly)

WinXp / VC2010

12
Window / window.getSize() ???
« on: June 02, 2015, 12:03:15 pm »
RenderWindow win(VideoMode(400,200),"123");
Event ev;
win.setSize(Vector2u(150,150));
cout << win.GetSize().x << endl;
cout << win.GetSize().y << endl;
while(win.pollEvent(ev)){}
cout << win.GetSize().x << endl;
cout << win.GetSize().y << endl;

400
200
150
150

And question...
We directly call function to resize window, why window sizes changes only after Event logic.
Maybe some function can detect changed size before Event ?
I can get this using winAPI.... using win.getSystemHandle()... but its.... ok try do something )

13
Window / Escape from window procedure ?
« on: May 21, 2015, 08:14:59 pm »
How ?)
For example while we resizing border of window - code stops implementation.
In that moment me need run another code....
I know about threads but need in one thread implementation.

14
Window / How to set proportional window border ?
« on: May 18, 2015, 09:26:45 pm »
How to set proportional window border changing ?
Like in Dont Starve game.

Because when I click and hold to border of window - no event detected.
Maybe its set up in window settings, but how?

P.s. I achieved window changing - resize window from different resize.
But need to directly 1 time change without re-change.

Thanks in advance.

15
Window / WinApi method for read key events buffer ?
« on: May 14, 2015, 01:29:51 pm »
What winApi method Sfml using for read key events buffer ?
Now look into this functions > GetKeyboardState / GetKeyState / GetAsyncKeyState....
Someone knows ?))

Pages: [1] 2