-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support Windows and Mac platform for editor #13394
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
9a5d0ba
Bug:native scene Winodws fix
dogeFu 6ab4f5a
feature:增加原生编辑器platform
dogeFu 66e4824
Merge remote-tracking branch 'cocos-for-editor/develop' into develop_…
dogeFu fd506ca
Merge remote-tracking branch 'cocos-for-editor/develop' into develop_…
dogeFu c14ab60
Merge commit '0521d1e566d0f2be2c7ca4172a161ff1f9b45009' into develop_…
dogeFu 6f92175
Merge remote-tracking branch 'cocos-for-editor/develop' into develop_…
dogeFu 672efa1
fix:fix gles3 render error in edior on Windows
dogeFu d255c1c
feat: support editor mac platform
dogeFu 7cfb75f
Merge commit '672efa1ea2a62952bbec113bddfc4c1cc4e967e4' into develop_…
dogeFu 598a5e2
update cmakelist
dogeFu 9f3f116
Merge remote-tracking branch 'cocos-for-editor/develop' into develop_…
dogeFu 3481e6f
fix:adapter object.cpp for editor
dogeFu f360b29
clang-format
dogeFu 62bb256
fix type error
dogeFu dc4702e
fix for pull request
dogeFu 30b66af
fix for pr:remove platform code,use cc_editor marco;fix clang tidy
dogeFu 2b50f7a
Update native/cocos/platform/mac/modules/Screen.mm
dogeFu 103ffb8
fix for pr: remove useless code,format code and handle path limit.
dogeFu 7038fbb
add autoHandleScope back
dogeFu effb0aa
remove EditorApplication
dogeFu ac82040
rename nsBuffer
dogeFu 207d3e7
fix spaces
dogeFu 5ed6171
fix code style problem
dogeFu a5980f0
fix error
dogeFu 0a4d5ee
fix type problem
dogeFu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ | |
****************************************************************************/ | ||
|
||
#include "GLES3Wrangler.h" | ||
#include <string> | ||
#include "base/Log.h" | ||
#include "base/memory/Memory.h" | ||
|
||
#if defined(_WIN32) && !defined(ANDROID) | ||
#define WIN32_LEAN_AND_MEAN 1 | ||
|
@@ -34,8 +37,38 @@ static HMODULE libgles = NULL; | |
static PFNGLES3WLOADPROC pfnGles3wLoad = NULL; | ||
|
||
bool gles3wOpen() { | ||
libegl = LoadLibraryA("libEGL.dll"); | ||
libgles = LoadLibraryA("libGLESv2.dll"); | ||
std::string eglPath = "libEGL.dll"; | ||
std::string glesPath = "libGLESv2.dll"; | ||
|
||
#if CC_EDITOR | ||
// In editor,there are same library,so we need to use abs path to load them. | ||
HMODULE engine = NULL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to use nullptr? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are NULL used in this file too. |
||
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | | ||
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, | ||
(LPCWSTR)&gles3wOpen, &engine) != 0) { | ||
std::string dir; | ||
int times = 1; | ||
do { | ||
auto size = MAX_PATH * times++; | ||
char *path = static_cast<char*>(CC_MALLOC(size)); | ||
if (path) { | ||
GetModuleFileNameA(engine, path, size); | ||
dir = path; | ||
} | ||
CC_FREE(path); | ||
} while (GetLastError() == ERROR_INSUFFICIENT_BUFFER); | ||
|
||
dir = dir.substr(0, dir.rfind("\\") + 1); | ||
eglPath = dir + eglPath; | ||
glesPath = dir + glesPath; | ||
} else { | ||
DWORD err = GetLastError(); | ||
CC_LOG_WARNING("Failed to get abs path for editor,error code:%lu", err); | ||
} | ||
#endif | ||
|
||
libegl = LoadLibraryA(eglPath.c_str()); | ||
libgles = LoadLibraryA(glesPath.c_str()); | ||
return (libegl && libgles); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch here. 👍