浏览代码

Updated readme and removed old comments.

David Piuva 7 月之前
父节点
当前提交
038b6ae2ec
共有 2 个文件被更改,包括 10 次插入37 次删除
  1. 10 12
      README.md
  2. 0 25
      Source/windowManagers/CocoaWindow.mm

+ 10 - 12
README.md

@@ -62,24 +62,22 @@ If you are not redistributing the source code, then you do not have to tell anyo
 Theme, GUI, font and sound APIs are still under active development and may have significant changes before a stable version 1.0 is ready, because some code is just a primitive placeholder until the advanced implementation can replace it, and one must try to actually use the library before usability problems become obvious. Buffer, file, image, draw, filter, string and time APIs are however already quite version stable. You can choose to stick with a specific version for each new project, keep updated with the latest changes, or wait for stable version 1.0.
 Theme, GUI, font and sound APIs are still under active development and may have significant changes before a stable version 1.0 is ready, because some code is just a primitive placeholder until the advanced implementation can replace it, and one must try to actually use the library before usability problems become obvious. Buffer, file, image, draw, filter, string and time APIs are however already quite version stable. You can choose to stick with a specific version for each new project, keep updated with the latest changes, or wait for stable version 1.0.
 
 
 ## How you can help
 ## How you can help
-* Test this beta version and give feedback on the design before version 1.0 is released.
+* Test this beta version, report bugs and give feedback on the design before version 1.0 is released.
 * Create different types of game engines with open-source tools.
 * Create different types of game engines with open-source tools.
 
 
 ## Supported CPU hardware:
 ## Supported CPU hardware:
-* **Intel/AMD** using **SSE2**, **AVX** and **AVX2** intrinsics and optional extensions.
+* **Intel/AMD** using **SSE2**, **SSSE3**, **AVX** and **AVX2** intrinsics.
 * **ARM** using **NEON** intrinsics.
 * **ARM** using **NEON** intrinsics.
 * Unknown CPU architectures, by running the same vector operations without SIMD hardware acceleration. This is still faster than naive loops with one iteration per element, because multiple scalar operations in parallel are better at filling the processor's execution window.
 * Unknown CPU architectures, by running the same vector operations without SIMD hardware acceleration. This is still faster than naive loops with one iteration per element, because multiple scalar operations in parallel are better at filling the processor's execution window.
 
 
+## Supported compilers:
+* g++ from the GCC toolchain.
+* clang++ from the Clang toolchain. Support for building with Objective-C and objective-C++ in projects.
+
 ## Platforms:
 ## Platforms:
 * **Linux**, tested on Mint, Mate, Manjaro, Ubuntu, RaspberryPi OS, Raspbian (Buster or later).
 * **Linux**, tested on Mint, Mate, Manjaro, Ubuntu, RaspberryPi OS, Raspbian (Buster or later).
 Linux Mint needs the compiler and X11 headers, so run "sudo apt install g++" and "sudo apt install libx11-dev" before compiling.
 Linux Mint needs the compiler and X11 headers, so run "sudo apt install g++" and "sudo apt install libx11-dev" before compiling.
-Currently supporting X11 and Wayland is planned for future versions.
-* **Microsoft Windows**, but slower than on Linux because Windows has lots of background processes and slower threading and memory management.
-
-## Partial support for:
-* MacOS still has features missing in the Cocoa integration, but will soon be officially supported.
-
-## Might also work on:
-* BSD and Solaris have code targeting the platforms in fileAPI.cpp for getting the application folder, but there are likely some applications missing for running the build script.
-Future Posix compliant systems should only have a few quirks to sort out if it has an X11 server.
-* Big-Endian is supported in theory if enabling the DSR_BIG_ENDIAN macro globally, but this has never actually been tested due to difficulties with targeting such an old system with modern compilers.
+Currently supporting X11.
+Support for Wayland will have to wait until it is possible to create a window without relying on contemporary extensions tied to specific desktop environments that come and go every month.
+* **Microsoft Windows**, but slower than on Linux and MacOS because Windows has very bad scheduling of processes.
+* **MacOS** still has features missing in the Cocoa integration, but will soon be officially supported.

+ 0 - 25
Source/windowManagers/CocoaWindow.mm

@@ -308,7 +308,6 @@ static dsr::DsrKey getDsrKey(uint16_t keyCode) {
 
 
 void CocoaWindow::prefetchEvents() {
 void CocoaWindow::prefetchEvents() {
 	@autoreleasepool {
 	@autoreleasepool {
-		// TODO: Send resize events to the program and resize the canvas when the canvas size has changed.
 		NSView *view = [window contentView];
 		NSView *view = [window contentView];
 		CGFloat canvasWidth = NSWidth(view.bounds);
 		CGFloat canvasWidth = NSWidth(view.bounds);
 		CGFloat canvasHeight = NSHeight(view.bounds);
 		CGFloat canvasHeight = NSHeight(view.bounds);
@@ -350,10 +349,8 @@ void CocoaWindow::prefetchEvents() {
 						this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Left, mousePosition);
 						this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Left, mousePosition);
 					}
 					}
 				} else if ([event type] == NSEventTypeLeftMouseDragged) {
 				} else if ([event type] == NSEventTypeLeftMouseDragged) {
-					//dsr::printText(U"LeftMouseDragged at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 				} else if ([event type] == NSEventTypeLeftMouseUp) {
 				} else if ([event type] == NSEventTypeLeftMouseUp) {
-					//dsr::printText(U"LeftMouseUp at ", mousePosition, U"\n");
 					if (this->modifiedClick == 1) {
 					if (this->modifiedClick == 1) {
 						// If the last left click was a control click, then the release should be treated as releasing the right mouse button.
 						// If the last left click was a control click, then the release should be treated as releasing the right mouse button.
 						this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Right, mousePosition);
 						this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Right, mousePosition);
@@ -367,29 +364,21 @@ void CocoaWindow::prefetchEvents() {
 					}
 					}
 				} else if ([event type] == NSEventTypeRightMouseDown) {
 				} else if ([event type] == NSEventTypeRightMouseDown) {
 					this->cursorInside = true; // In case that enter events are missing, any proof of being inside of the window should be used.
 					this->cursorInside = true; // In case that enter events are missing, any proof of being inside of the window should be used.
-					//dsr::printText(U"RightMouseDown at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Right, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Right, mousePosition);
 				} else if ([event type] == NSEventTypeRightMouseDragged) {
 				} else if ([event type] == NSEventTypeRightMouseDragged) {
-					//dsr::printText(U"RightMouseDragged at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 				} else if ([event type] == NSEventTypeRightMouseUp) {
 				} else if ([event type] == NSEventTypeRightMouseUp) {
-					//dsr::printText(U"RightMouseUp at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Right, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Right, mousePosition);
 				} else if ([event type] == NSEventTypeOtherMouseDown) {
 				} else if ([event type] == NSEventTypeOtherMouseDown) {
 					this->cursorInside = true; // In case that enter events are missing, any proof of being inside of the window should be used.
 					this->cursorInside = true; // In case that enter events are missing, any proof of being inside of the window should be used.
-					//dsr::printText(U"OtherMouseDown at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Middle, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseDown, dsr::MouseKeyEnum::Middle, mousePosition);
 				} else if ([event type] == NSEventTypeOtherMouseDragged) {
 				} else if ([event type] == NSEventTypeOtherMouseDragged) {
-					//dsr::printText(U"OtherMouseDragged at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 				} else if ([event type] == NSEventTypeOtherMouseUp) {
 				} else if ([event type] == NSEventTypeOtherMouseUp) {
-					//dsr::printText(U"OtherMouseUp at ", mousePosition, U"\n");
 					this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Middle, mousePosition);
 					this->receivedMouseEvent(dsr::MouseEventType::MouseUp, dsr::MouseKeyEnum::Middle, mousePosition);
 				} else if ([event type] == NSEventTypeMouseMoved) {
 				} else if ([event type] == NSEventTypeMouseMoved) {
-					//dsr::printText(U"cursorInside = ", this->cursorInside, U"\n");
 					// When not dragging, only allow move events inside of the view, to be consistent with other operating systems.
 					// When not dragging, only allow move events inside of the view, to be consistent with other operating systems.
 					if (this->cursorInside && mousePosition.y >= 0) {
 					if (this->cursorInside && mousePosition.y >= 0) {
-						//dsr::printText(U"MouseMoved at ", mousePosition, U"\n");
 						this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 						this->receivedMouseEvent(dsr::MouseEventType::MouseMove, dsr::MouseKeyEnum::NoKey, mousePosition);
 					}
 					}
 				} else if ([event type] == NSEventTypeMouseEntered) {
 				} else if ([event type] == NSEventTypeMouseEntered) {
@@ -398,17 +387,13 @@ void CocoaWindow::prefetchEvents() {
 					// Only accept enter events to our view.
 					// Only accept enter events to our view.
 					if (event.trackingNumber == this->trackingNumber) {
 					if (event.trackingNumber == this->trackingNumber) {
 						this->cursorInside = true;
 						this->cursorInside = true;
-						//dsr::printText(U"MouseEntered at ", mousePosition, U" in ", event.trackingNumber, U"\n");
 					}
 					}
 				} else if ([event type] == NSEventTypeMouseExited) {
 				} else if ([event type] == NSEventTypeMouseExited) {
 					// Only accept exit events from our view.
 					// Only accept exit events from our view.
 					if (event.trackingNumber == this->trackingNumber) {
 					if (event.trackingNumber == this->trackingNumber) {
 						this->cursorInside = false;
 						this->cursorInside = false;
-						//dsr::printText(U"MouseExited at ", mousePosition, U" in ", event.trackingNumber, U"\n");
 					}
 					}
 				} else if ([event type] == NSEventTypeScrollWheel) {
 				} else if ([event type] == NSEventTypeScrollWheel) {
-					//dsr::printText(U"ScrollWheel at ", mousePosition, U"\n");
-					// TODO: Which direction is considered up/down on MacOS when scroll wheels are inverted relative to PC?
 					if (event.scrollingDeltaY > 0.0) {
 					if (event.scrollingDeltaY > 0.0) {
 						this->receivedMouseEvent(dsr::MouseEventType::Scroll, dsr::MouseKeyEnum::ScrollUp, mousePosition);
 						this->receivedMouseEvent(dsr::MouseEventType::Scroll, dsr::MouseKeyEnum::ScrollUp, mousePosition);
 					}
 					}
@@ -423,7 +408,6 @@ void CocoaWindow::prefetchEvents() {
 				dsr::DsrKey code = getDsrKey(event.keyCode);
 				dsr::DsrKey code = getDsrKey(event.keyCode);
 				if ([event type] == NSEventTypeKeyDown) {
 				if ([event type] == NSEventTypeKeyDown) {
 					if (!(event.isARepeat)) {
 					if (!(event.isARepeat)) {
-						//dsr::printText(U"KeyDown: keyCode ", event.keyCode, U" -> ", getName(code), U"\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', code);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', code);
 					}
 					}
 					// Get typed characters
 					// Get typed characters
@@ -439,12 +423,9 @@ void CocoaWindow::prefetchEvents() {
 							}
 							}
 						}
 						}
 					}
 					}
-					//dsr::printText(U"KeyType: keyCode ", event.keyCode, U" -> ", getName(code), U"\n");
 				} else if ([event type] == NSEventTypeKeyUp) {
 				} else if ([event type] == NSEventTypeKeyUp) {
-					//dsr::printText(U"KeyUp: keyCode ", event.keyCode, U" -> ", getName(code), U"\n");
 					this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', code);
 					this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', code);
 				} else if ([event type] == NSEventTypeFlagsChanged) {
 				} else if ([event type] == NSEventTypeFlagsChanged) {
-					//dsr::printText(U"FlagsChanged\n");
 					NSEventModifierFlags newModifierFlags = [event modifierFlags];
 					NSEventModifierFlags newModifierFlags = [event modifierFlags];
 					bool newControl = (newModifierFlags & NSEventModifierFlagControl) != 0u;
 					bool newControl = (newModifierFlags & NSEventModifierFlagControl) != 0u;
 					bool newCommand = (newModifierFlags & NSEventModifierFlagCommand) != 0u;
 					bool newCommand = (newModifierFlags & NSEventModifierFlagCommand) != 0u;
@@ -452,24 +433,18 @@ void CocoaWindow::prefetchEvents() {
 					bool newShift = (newModifierFlags & NSEventModifierFlagShift) != 0u;
 					bool newShift = (newModifierFlags & NSEventModifierFlagShift) != 0u;
 					bool newAltOption = (newModifierFlags & NSEventModifierFlagOption) != 0u;
 					bool newAltOption = (newModifierFlags & NSEventModifierFlagOption) != 0u;
 					if (newControlCommand && !pressedControlCommand) {
 					if (newControlCommand && !pressedControlCommand) {
-						//dsr::printText(U"KeyDown: Control\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Control);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Control);
 					} else if (!newControlCommand && pressedControlCommand) {
 					} else if (!newControlCommand && pressedControlCommand) {
-						//dsr::printText(U"KeyUp: Control\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Control);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Control);
 					}
 					}
 					if (newShift && !pressedShift) {
 					if (newShift && !pressedShift) {
-						//dsr::printText(U"KeyDown: Shift\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Shift);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Shift);
 					} else if (!newShift && pressedShift) {
 					} else if (!newShift && pressedShift) {
-						//dsr::printText(U"KeyUp: Shift\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Shift);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Shift);
 					}
 					}
 					if (newAltOption && !pressedAltOption) {
 					if (newAltOption && !pressedAltOption) {
-						//dsr::printText(U"KeyDown: Alt\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Alt);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyDown, U'\0', dsr::DsrKey_Alt);
 					} else if (!newAltOption && pressedAltOption) {
 					} else if (!newAltOption && pressedAltOption) {
-						//dsr::printText(U"KeyUp: Alt\n");
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Alt);
 						this->receivedKeyboardEvent(dsr::KeyboardEventType::KeyUp, U'\0', dsr::DsrKey_Alt);
 					}
 					}
 					this->pressedControl = newControl;
 					this->pressedControl = newControl;