Welcome, Guest. Please login or register. Did you miss your activation email?

Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
Hello everyone, I have designed an RPG online game that cannot expand the input method candidate window in full screen mode. No matter what setting I try, it cannot expand, but it works normally on other engines and can display input method candidate windows. This is my code. Please provide suggestions

void   StartInDrawText(int sX, int sY, uint32 iLen, char* pBuffer, bool bIsHide, int right)
{
        m_InputStatus = TRUE;
        m_iInputX = sX;
        m_iInputY = sY;
        m_pInputBuffer = pBuffer;
        ZeroMemory(m_cEdit, sizeof(m_cEdit));
        m_inputMaxLen = iLen;
        m_iInputX2 = right;
   G_hEditWnd = CreateWindow(RICHEDIT_CLASS, NULL, WS_POPUP | ES_SELFIME, sX - 5, sY - 1, iLen * 12, 16, g_window, (HMENU)0, g_instance, NULL);

        SetWindowText(G_hEditWnd, m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_EXLIMITTEXT, 0, iLen - 1);
        SendMessage(G_hEditWnd, EM_SETLANGOPTIONS, 0, ~IMF_AUTOFONT);
        COMPOSITIONFORM composform;
        composform.dwStyle = CFS_POINT;
        composform.ptCurrentPos.x = sX;
        composform.ptCurrentPos.y = sY;
        HIMC hImc = ImmGetContext(g_window);
        ImmSetCompositionWindow(hImc, &composform);
        int StrLen = strlen(m_pInputBuffer);
        SendMessage(G_hEditWnd, EM_SETSEL, StrLen, StrLen);

 
}
62
Graphics / Re: Drawing a subset of a vertex array?
« Last post by eXpl0it3r on November 24, 2024, 01:36:09 pm »
Unfortunately, SFML.Net doesn't offer anything like that, but you can use LINQ to Skip() to the wanted position.
63
You need to understand that your use case of printing all the characters in existence is very niche/unusual one, which SFML ends up not being optimized for or offering any easy option to deal with.

Yes, it's not (just) about VRAM, but the texture size.
This limitation is of course on its own not very niche and there has been some attempts to add support for multiple textures, to work around it.

Currently, there isn't really a way around this beyond resetting the font.
You could see if it helps to load the font into memory and use openFromMemory, that way you at least wouldn't need to go to the disk, at the cost of a few MB of memory.

Also, make sure you're measuring the changes in release mode. Especially around construction/destruction you can get way worse performance in debug mode.
I see, thanks for your answer :)
64
SFML projects / Re: Shape Wars - A 2d Shooter
« Last post by Herogo3241 on November 23, 2024, 03:38:56 pm »
Thanks ;D
65
SFML projects / Re: Shape Wars - A 2d Shooter
« Last post by eXpl0it3r on November 23, 2024, 02:33:55 pm »
Nice! :)

I like the trail effect!
66
You need to understand that your use case of printing all the characters in existence is very niche/unusual one, which SFML ends up not being optimized for or offering any easy option to deal with.

Yes, it's not (just) about VRAM, but the texture size.
This limitation is of course on its own not very niche and there has been some attempts to add support for multiple textures, to work around it.

Currently, there isn't really a way around this beyond resetting the font.
You could see if it helps to load the font into memory and use openFromMemory, that way you at least wouldn't need to go to the disk, at the cost of a few MB of memory.

Also, make sure you're measuring the changes in release mode. Especially around construction/destruction you can get way worse performance in debug mode.
67
Instead of completely reloading the font from file, you could make a copy of the sf::Font instance before rendering characters, and use it to reset your working sf::Font instance from time to time by assigning to it. This will reuse the same underlying FreeType objects under the hood but start with new empty textures.
thanks for it. 👍 but this is not much different from what I wrote, and does not change the underlying problem. I compared the two by the time it takes to iterate over a CJK Unicode block without limiting the fps, and the difference is about 200 milliseconds.
68
"Failed to add a new character to the font: the maximum texture size has been reached."
This error is not entirely due to the low video memory of my laptop. I tested it on my other pc with 8gb vram. This problem still occurs without manually clearing the cache at certain intervals.Apparently, this is caused by keep adding large character texture caches to the vram. I am very frustrated by this problem. It would be great if sfml had an API to turn off the default behavior of automatically caching character textures in video memory.
69
SFML projects / Shape Wars - A 2d Shooter
« Last post by Herogo3241 on November 23, 2024, 05:32:54 am »
Hi Guys, this is my first time using SFML, i created a 2d shooter

https://herogo3241.itch.io/shape-wars

feel free to review it



70
General / Re: Why~400 FPS difference between these two methods of building a vertex array
« Last post by IGD on November 23, 2024, 01:39:52 am »
So I continued digging, and I found this:
https://en.sfml-dev.org/forums/index.php?topic=22780.0

Upon looking at my code deeper, I noticed I was in fact resizing the vertex array before utilizing append, which, as was the case with the previous poster, led to double the vertices.
Pages: 1 ... 5 6 [7] 8 9 10
anything