early-access version 2835
This commit is contained in:
+32
-21
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -21,6 +21,7 @@
|
||||
#ifndef SDL_BAPP_H
|
||||
#define SDL_BAPP_H
|
||||
|
||||
#include <Path.h>
|
||||
#include <InterfaceKit.h>
|
||||
#include <LocaleRoster.h>
|
||||
#if SDL_VIDEO_OPENGL
|
||||
@@ -93,6 +94,15 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void RefsReceived(BMessage* message) {
|
||||
char filePath[512];
|
||||
entry_ref entryRef;
|
||||
for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) {
|
||||
BPath referencePath = BPath(&entryRef);
|
||||
SDL_SendDropFile(NULL, referencePath.Path());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Event-handling functions */
|
||||
virtual void MessageReceived(BMessage* message) {
|
||||
@@ -198,6 +208,10 @@ public:
|
||||
}
|
||||
|
||||
#if SDL_VIDEO_OPENGL
|
||||
BGLView *GetCurrentContext() {
|
||||
return _current_context;
|
||||
}
|
||||
|
||||
void SetCurrentContext(BGLView *newContext) {
|
||||
if(_current_context)
|
||||
_current_context->UnlockGL();
|
||||
@@ -234,25 +248,22 @@ private:
|
||||
}
|
||||
win = GetSDLWindow(winID);
|
||||
|
||||
// Simple relative mode support for mouse.
|
||||
if (SDL_GetMouse()->relative_mode) {
|
||||
int winWidth, winHeight, winPosX, winPosY;
|
||||
SDL_GetWindowSize(win, &winWidth, &winHeight);
|
||||
SDL_GetWindowPosition(win, &winPosX, &winPosY);
|
||||
int dx = x - (winWidth / 2);
|
||||
int dy = y - (winHeight / 2);
|
||||
SDL_SendMouseMotion(win, 0, SDL_GetMouse()->relative_mode, dx, dy);
|
||||
set_mouse_position((winPosX + winWidth / 2), (winPosY + winHeight / 2));
|
||||
if (!be_app->IsCursorHidden())
|
||||
be_app->HideCursor();
|
||||
} else {
|
||||
SDL_SendMouseMotion(win, 0, 0, x, y);
|
||||
if (SDL_ShowCursor(-1) && be_app->IsCursorHidden())
|
||||
be_app->ShowCursor();
|
||||
}
|
||||
|
||||
/* Tell the application that the mouse passed over, redraw needed */
|
||||
HAIKU_UpdateWindowFramebuffer(NULL,win,NULL,-1);
|
||||
// Simple relative mode support for mouse.
|
||||
if (SDL_GetMouse()->relative_mode) {
|
||||
int winWidth, winHeight, winPosX, winPosY;
|
||||
SDL_GetWindowSize(win, &winWidth, &winHeight);
|
||||
SDL_GetWindowPosition(win, &winPosX, &winPosY);
|
||||
int dx = x - (winWidth / 2);
|
||||
int dy = y - (winHeight / 2);
|
||||
SDL_SendMouseMotion(win, 0, SDL_GetMouse()->relative_mode, dx, dy);
|
||||
set_mouse_position((winPosX + winWidth / 2), (winPosY + winHeight / 2));
|
||||
if (!be_app->IsCursorHidden())
|
||||
be_app->HideCursor();
|
||||
} else {
|
||||
SDL_SendMouseMotion(win, 0, 0, x, y);
|
||||
if (SDL_ShowCursor(-1) && be_app->IsCursorHidden())
|
||||
be_app->ShowCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void _HandleMouseButton(BMessage *msg) {
|
||||
@@ -300,7 +311,7 @@ private:
|
||||
}
|
||||
HAIKU_SetKeyState(scancode, state);
|
||||
SDL_SendKeyboardKey(state, HAIKU_GetScancodeFromBeKey(scancode));
|
||||
|
||||
|
||||
if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
|
||||
const int8 *keyUtf8;
|
||||
ssize_t count;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
SDL_ngage_main.c, originally for SDL 1.2 by Hannu Viitala
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
/* Include the SDL main definition header */
|
||||
#include "SDL_main.h"
|
||||
|
||||
#include <e32std.h>
|
||||
#include <e32def.h>
|
||||
#include <e32svr.h>
|
||||
#include <e32base.h>
|
||||
#include <estlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <w32std.h>
|
||||
#include <apgtask.h>
|
||||
|
||||
#include "SDL_error.h"
|
||||
|
||||
extern "C" int main(int argc, char *argv[]);
|
||||
|
||||
TInt E32Main()
|
||||
{
|
||||
/* Get the clean-up stack */
|
||||
CTrapCleanup* cleanup = CTrapCleanup::New();
|
||||
|
||||
/* Arrange for multi-threaded operation */
|
||||
SpawnPosixServerThread();
|
||||
|
||||
/* Get args and environment */
|
||||
int argc = 0;
|
||||
char** argv = 0;
|
||||
char** envp = 0;
|
||||
|
||||
__crt0(argc,argv,envp);
|
||||
|
||||
/* Start the application! */
|
||||
|
||||
/* Create stdlib */
|
||||
_REENT;
|
||||
|
||||
/* Set process and thread priority and name */
|
||||
|
||||
RThread currentThread;
|
||||
RProcess thisProcess;
|
||||
TParse exeName;
|
||||
exeName.Set(thisProcess.FileName(), NULL, NULL);
|
||||
currentThread.Rename(exeName.Name());
|
||||
currentThread.SetProcessPriority(EPriorityLow);
|
||||
currentThread.SetPriority(EPriorityMuchLess);
|
||||
|
||||
/* Increase heap size */
|
||||
RHeap* newHeap = NULL;
|
||||
RHeap* oldHeap = NULL;
|
||||
TInt heapSize = 7500000;
|
||||
int ret;
|
||||
|
||||
newHeap = User::ChunkHeap(NULL, heapSize, heapSize, KMinHeapGrowBy);
|
||||
|
||||
if (NULL == newHeap)
|
||||
{
|
||||
ret = 3;
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldHeap = User::SwitchHeap(newHeap);
|
||||
/* Call stdlib main */
|
||||
SDL_SetMainReady();
|
||||
ret = SDL_main(argc, argv);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
_cleanup();
|
||||
|
||||
CloseSTDLIB();
|
||||
delete cleanup;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
SDL_uikit_main.c, placed in the public domain by Sam Lantinga 3/18/2019
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
/* Include the SDL main definition header */
|
||||
#include "SDL_main.h"
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ main_getcmdline(void)
|
||||
if (!argv[i]) {
|
||||
return OutOfMemory();
|
||||
}
|
||||
CopyMemory(argv[i], arg, len);
|
||||
SDL_memcpy(argv[i], arg, len);
|
||||
SDL_free(arg);
|
||||
}
|
||||
argv[i] = NULL;
|
||||
|
||||
+5
-5
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,19,0
|
||||
PRODUCTVERSION 2,0,19,0
|
||||
FILEVERSION 2,23,1,0
|
||||
PRODUCTVERSION 2,23,1,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
FILEFLAGS 0x0L
|
||||
FILEOS 0x40004L
|
||||
@@ -23,12 +23,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "SDL\0"
|
||||
VALUE "FileVersion", "2, 0, 19, 0\0"
|
||||
VALUE "FileVersion", "2, 23, 1, 0\0"
|
||||
VALUE "InternalName", "SDL\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2021 Sam Lantinga\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2022 Sam Lantinga\0"
|
||||
VALUE "OriginalFilename", "SDL2.dll\0"
|
||||
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
||||
VALUE "ProductVersion", "2, 0, 19, 0\0"
|
||||
VALUE "ProductVersion", "2, 23, 1, 0\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Reference in New Issue
Block a user