This commit is contained in:
Astrofra 2022-10-25 17:22:41 +02:00
commit 12f901108c
6 changed files with 66 additions and 10 deletions

11
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,11 @@
## Contributor License Agreement
By contributing your code to HARFANG you grant the [HARFANG3D organization](https://www.harfang3d.com/en_US/legal) a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation:
(a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.
You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.
The [HARFANG3D organization](https://www.harfang3d.com/en_US/legal) acknowledges that, except as explicitly described in this Agreement, any Contribution which you provide is on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

View File

@ -10,9 +10,12 @@
#include "engine/ogg_audio_stream.h"
#include "engine/wav_audio_stream.h"
#ifndef EMSCRIPTEN
#include <AL/alc.h>
#include <AL/alext.h>
#if !defined(__EMSCRIPTEN__)
#include <AL/alext.h>
#else
#include <AL/al.h>
#endif
#include <bx/bx.h>
@ -625,4 +628,3 @@ void StopAllSources() {
}
} // namespace hg
#endif

View File

@ -12,6 +12,9 @@ void set_thread_name(const std::string &name) {}
std::string get_thread_name(std::thread::id id) { return "Unsupported"; }
bool set_thread_priority(std::thread::native_handle_type handle, unsigned int priority) {
#if defined(__EMSCRIPTEN__)
return true;
#else
if (!handle)
return false;
@ -20,6 +23,7 @@ bool set_thread_priority(std::thread::native_handle_type handle, unsigned int pr
param.sched_priority = priority;
return pthread_setschedparam(handle, SCHED_OTHER, &param) == 0;
#endif
}
bool set_thread_affinity(std::thread::native_handle_type handle, unsigned int mask) { return false; }

View File

@ -1,5 +1,5 @@
// HARFANG(R) Copyright (C) 2019 Emmanuel Julien, Movida Production. Released under GPL/LGPL/Commercial Licence, see licence.txt for details.
#include "../platform.h"
#include "foundation/assert.h"
#include "foundation/format.h"
#include "foundation/log.h"
@ -13,19 +13,31 @@ bool InitPlatform() {
return true;
}
enum class Action : int {
FileOpen = 0,
FileSave,
SelectFolder,
Count
};
std::string GetPlatformLocale() {
return "fr";
return "C";
}
#pragma message "SDL2 dialogs not implemented for WASM"
bool OpenFolderDialog(const std::string &title, std::string &OUTPUT, const std::string &initial_dir) {
puts(__FILE__ ":OpenFolderDialog");
return false;
}
bool OpenFileDialog(const std::string &title, const std::string &filter, std::string &OUTPUT, const std::string &initial_dir) {
bool OpenFileDialog(const std::string &title, const std::vector<FileFilter> &filters, std::string &output, const std::string &initial_dir) {
puts(__FILE__ ":OpenFileDialog");
return false;
}
bool SaveFileDialog(const std::string &title, const std::string &filter, std::string &OUTPUT, const std::string &initial_dir) {
bool SaveFileDialog(const std::string &title, const std::vector<FileFilter> &filters, std::string &output, const std::string &initial_dir) {
puts(__FILE__ ":SaveFileDialog");
return false;
}

View File

@ -100,11 +100,17 @@ Window *NewWindowFrom(void *handle) {
}
// TODO Create a new fullscreen window on a specified monitor.
Window *NewFullscreenWindow(const Monitor *monitor, int mode_index, MonitorRotation rotation) { return NewWindow(512, 512, 32, WV_Windowed); }
Window *NewFullscreenWindow(const Monitor *monitor, int mode_index, MonitorRotation rotation) {
return NewWindow(512, 512, 32, WV_Windowed);
}
Window * NewFullscreenWindow(const char *title, const Monitor *monitor, int mode_index, MonitorRotation rotation) {
return NewWindow(512, 512, 32, WV_Windowed);
}
void *GetDisplay() { return nullptr; }
static const char *canvas_name = "canvas";
static const char *canvas_name = "#canvas";
void *GetWindowHandle(const Window *w) {
return (void *)canvas_name;
// return reinterpret_cast<void *>(w->w);
@ -161,7 +167,7 @@ bool SetWindowTitle(Window *w, const std::string &title) { return true; }
bool WindowHasFocus(const Window *w) { return true; }
bool SetWindowPos(const Window *w, const hg::iVec2 &v) {
bool SetWindowPos(Window *w, const hg::iVec2 &v) {
SDL_SetWindowPosition(w->w, v.x, v.y);
UpdateWindow(w); // process messages on the spot
return true;
@ -176,7 +182,13 @@ hg::iVec2 GetWindowPos(const Window *w) {
return pos;
}
hg::Vec2 GetWindowContentScale(const Window *window) {
puts(__FILE__ "GetWindowContentScale");
return { 1, 1 };
}
void ShowCursor() { SDL_ShowCursor(SDL_ENABLE); }
void HideCursor() { SDL_ShowCursor(SDL_DISABLE); }
void WindowSystemShutdown() { }
} // namespace hg

View File

@ -19,6 +19,7 @@ HARFANG®3D is an all-in-one 3D visualization library usable in C++, Python, Lua
4. [Using the C++ SDK](#section_4)
5. [Version](#section_5)
6. [License](#section_6)
7. [Contributing](#section_7)
<a name="section_1"></a>
# About
@ -240,6 +241,20 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
Harfang is licensed under the GPLv3, LGPLv3 and a commercial license:<br>
https://www.harfang3d.com/license
<a name="section_7"></a>
# Contributing
## Contributor License Agreement
By contributing your code to HARFANG you grant the [HARFANG3D organization](https://www.harfang3d.com/en_US/legal) a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation:
(a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.
You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.
The [HARFANG3D organization](https://www.harfang3d.com/en_US/legal) acknowledges that, except as explicitly described in this Agreement, any Contribution which you provide is on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
<a name="section_8"></a>
# More screenshots...
![alt text](https://raw.githubusercontent.com/harfang3d/image-storage/main/portfolio/3.1.1/sun_temple_aaa.png)