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

Pages: 1 ... 4 5 [6]
76
Window / Questions about sf::Input
« on: January 02, 2011, 07:25:06 am »
but won't the mouse position from sf::Event and sf::Input yield the same result?

e.g
1. Get mouse coord e.g (250, 280)
2. store the mouse coord in the my program
3. mouse is moved to (270, 200)
4. an sf::Event is fired off by the OS
5. Read sf::Event from event loop and update the new mouse coord

Suppose I do something as above, would it be less real time from the sf::Input version?

regards

77
Window / Questions about sf::Input
« on: January 02, 2011, 03:09:51 am »
Hi, I am wondering how does sf::Input work, does it works as how the tutorial said? which is have a boolean variable to store the key state/mouse button state? And this boolean variable will be flag accordingly to the Event?

I roughly understand the need for sf::Input for realtime inputs. However I don't really understand why the need for sf::Input::GetMouseX/Y. Wouldn't the mouse position from the event suffice for realtime input?

Since I assume that whether a person get the mouse position from the Event or from the sf::Input, wouldn't it be the same until the next mouse move sf::event is fired?

regards

78
Window / mulitple sf::window and OpenGL
« on: December 31, 2010, 01:13:24 pm »
Hi Laurent, I don't quite understand what you mean, could you explain it abit further?

Does that mean, that each thread with a different sf::Window have a different rendering context?

say I have a function with draw a cube, basically a glBeing, glEnd pair and some glVertex3f. How would I know which window will it appear on?

79
Window / mulitple sf::window and OpenGL
« on: December 31, 2010, 01:02:25 pm »
ahh thanks, then I guess opengl will then draw to which ever window is active then??

If 2 windows on separate threads are active at the same time, would it cause an error? or what would happen? as in would an exception be thrown or would any error flag be set?

80
Window / mulitple sf::window and OpenGL
« on: December 31, 2010, 12:26:00 pm »
hi if i have multiple sf::Window, can they be on different threads? and if I am to call glBegin() glEnd() from a different thread will it work?

e,g
thread1 : sf::Window A
thread2 : sf::Window B
thread3 : sf::Window C
thread4 : glBegin()/glEnd() other opengl commands

is this allowed?? or mus all sf::Window(s) reside on the same thread along with all opengl commands?

81
Window / Can GetEvent or sf::Input be called from another thread?
« on: December 31, 2010, 12:21:05 pm »
for me my system is design base on a thread pool. So a subsystem is technically not bounded to any thread but spreaded in the pool. However as the sf::Input and GetEvent can't be separated from the main thread, I just forced them together :)

The main advantage of using a thread pool is so that we are not locked to 1 subsystem per thread, and we can scale the number of threads as and when the computer has more cores available.

82
Window / Can GetEvent or sf::Input be called from another thread?
« on: December 29, 2010, 10:34:10 am »
Hi I was wondering if sf::Window::GetEvent or sf::Input be used from another thread from that of which the window is created?

for example
thread 1: Create the Window and do all rendering (aka Graphics Thread)
thread 2: Physics Thread
thread 3: Main Loop where I call window::GetEvent or use the sf::Input here?

is this possible??

regards

83
Window / SFML error checking and exceptions
« on: December 27, 2010, 12:11:50 pm »
Hi, do SFML throw exceptions in any of the classes? If not how should I check for failures? for example when creating the sf::Window class, how would I know if the constructor failed? or sf::Window::Create failed?

84
Window / Is there anyway to specify the bit size for each channel?
« on: December 27, 2010, 10:40:04 am »
ahh, I was just wondering if 32bpp would R8G8B8A8? and 24 would mean R8G8B8A0?

85
Window / Is there anyway to specify the bit size for each channel?
« on: December 27, 2010, 08:10:00 am »
Hi I was wondering is there anyway to specify the channel size for each RGBA component when creating the window/opengl context?

regards

86
General / Static linking giving warning and mem leak in debug
« on: December 22, 2010, 02:05:48 am »
I am wondering if there is any other information that i do need to provide, and whether is there something wrong with my code, which causes these memory leaks?

87
General / Static linking giving warning and mem leak in debug
« on: December 21, 2010, 09:13:04 pm »
hmm, I am using the crt to detect memory leak in VS2010. Hence when the program quit, it will appear in the output window
Code: [Select]

'test.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Symbols loaded (source information stripped).
'test.exe': Loaded 'C:\Windows\System32\nvoglv32.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0x15f4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1544) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1644) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1650) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1664) has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{135} normal block at 0x00D07418, 20 bytes long.
 Data: < t   t   t      > 18 74 D0 00 18 74 D0 00 18 74 D0 00 CD CD CD CD
{134} normal block at 0x00D073E0, 8 bytes long.
 Data: <        > E4 80 D0 00 00 00 00 00
{133} normal block at 0x00D080D8, 384 bytes long.
 Data: <             s  > 84 83 1D 01 01 00 00 00 01 00 00 00 E0 73 D0 00
{132} normal block at 0x00581990, 4 bytes long.
 Data: <    > D8 80 D0 00
Object dump complete.
The program '[5504] test.exe: Native' has exited with code 0 (0x0).


Even when trying to break on the allocation for 135/134/132/133 nothing happens. I guess this is because it does not have the pdb files for the sfml portion.

The exact functions i am using to detect memory leaks are

Code: [Select]

_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
_CrtSetBreakAlloc(a);
_CrtDumpMemoryLeaks();

88
General / Static linking giving warning and mem leak in debug
« on: December 21, 2010, 01:22:38 am »
The try-catch is because I will be adding other code to it which can throw exceptions.

How do i get information about the memory leak?

89
General / Static linking giving warning and mem leak in debug
« on: December 20, 2010, 11:36:52 pm »
Hi, I created a project in VS2010 and in debug mode, I link to
sfml-system-s-d.lib
sfml-window-s-d.lib

Code: [Select]

int main(int argc, char* args[])
{
    DETECT_MEMORY_LEAK;

    try
    {
        sf::Window App;
    }
    catch (std::exception& err)
    {
        std::cout << err.what() << "\n";
    }

    std::cin.get();

    return 0;
}


however when i compile it gives a lot of warning:
Code: [Select]

1>sfml-system-s-d.lib(Platform.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'sfml-system-s-d.lib(Platform.obj)' or at 'C:\ Framework\Debug\vc100.pdb'; linking object as if no debug info
1>sfml-system-s-d.lib(Clock.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'sfml-system-s-d.lib(Clock.obj)' or at 'C:\Framework\Debug\vc100.pdb'; linking object as if no debug info


but it still run fines. I guess because it can't find the symbol to load for debugging?

However when I exit the program. The CRT is detecting a number of memory leaks. I am using the _CrtDumpMemoryLeaks() along with _CrtSetDbgFlag(), to check for memory leaks.

regards

Pages: 1 ... 4 5 [6]
anything