Atlas - SDL_riscosmouse.c
Home / ext / SDL / src / video / riscos Lines: 1 | Size: 2372 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21#include "SDL_internal.h" 22 23#ifdef SDL_VIDEO_DRIVER_RISCOS 24 25#include "SDL_riscosvideo.h" 26#include "SDL_riscosmouse.h" 27#include "../../events/SDL_mouse_c.h" 28 29#include <kernel.h> 30 31static SDL_Cursor *RISCOS_CreateDefaultCursor(void) 32{ 33 SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); 34 if (cursor) { 35 // NULL is used to indicate the default cursor 36 cursor->internal = NULL; 37 } 38 39 return cursor; 40} 41 42static void RISCOS_FreeCursor(SDL_Cursor *cursor) 43{ 44 SDL_free(cursor); 45} 46 47static bool RISCOS_ShowCursor(SDL_Cursor *cursor) 48{ 49 if (cursor) { 50 // Turn the mouse pointer on 51 _kernel_osbyte(106, 1, 0); 52 } else { 53 // Turn the mouse pointer off 54 _kernel_osbyte(106, 0, 0); 55 } 56 57 return true; 58} 59 60bool RISCOS_InitMouse(SDL_VideoDevice *_this) 61{ 62 SDL_Mouse *mouse = SDL_GetMouse(); 63 64 // mouse->CreateCursor = RISCOS_CreateCursor; 65 // mouse->CreateSystemCursor = RISCOS_CreateSystemCursor; 66 mouse->ShowCursor = RISCOS_ShowCursor; 67 mouse->FreeCursor = RISCOS_FreeCursor; 68 // mouse->WarpMouse = RISCOS_WarpMouse; 69 // mouse->WarpMouseGlobal = RISCOS_WarpMouseGlobal; 70 // mouse->SetRelativeMouseMode = RISCOS_SetRelativeMouseMode; 71 // mouse->CaptureMouse = RISCOS_CaptureMouse; 72 // mouse->GetGlobalMouseState = RISCOS_GetGlobalMouseState; 73 74 SDL_SetDefaultCursor(RISCOS_CreateDefaultCursor()); 75 76 return true; 77} 78 79#endif // SDL_VIDEO_DRIVER_RISCOS 80[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.