c++ - SDL - Window data -


I was browsing the SDL documentation and found me the WindowData (and). What is the use of these works? It stores the zero pointer attached to the name, is it only to store my items, which I can use later? Or what is the significance of its SDL ?

These actions should let you know arbitrary data with an indicator object (like a memory of your choice Buffer or an object):

  MyObject * object_ptr = new MyObject (); // Your custom object object_ptr-> Data = 42; // Your custom data SDL_SetWindowData (window, "mycustomdata", object_ptr); // elsewhere in your code where you have access to 'window' MyObject * object_ptr = SDL_GetWindowData (window, "mycustomdata");  

This behavior mimics SetWindowLong (hwnd, GWL_USERDATA, indicator); Call the Win32 API.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -