Skip to content
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

Feature: 公开头文件中加入版本宏 #143

Merged
merged 3 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/ege.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************
* EGE (Easy Graphics Engine)
* EGE (Easy Graphics Engine) 20.08
* FileName ege.h
* HomePage1 http://misakamm.github.com/xege
* HomePage2 http://misakamm.bitbucket.org/index.htm
Expand Down Expand Up @@ -37,6 +37,15 @@
#pragma once
#endif

// Easy Graphics Engine Version
// Calendar Versioning, format: YY.0M.PatchNumber (If the PatchNumber equals 0, the YY.0M format is used.)
#define EGE_VERSION "20.08"
#define EGE_VERSION_MAJOR 20
#define EGE_VERSION_MINOR 8
#define EGE_VERSION_PATCH 0
#define EGE_MAKE_VERSION_NUMBER(major, minor, patch) ((major) * 10000L + (minor) * 100L + (patch))
#define EGE_VERSION_NUMBER EGE_MAKE_VERSION_NUMBER(EGE_VERSION_MAJOR, EGE_VERSION_MINOR, EGE_VERSION_PATCH)

#ifndef __cplusplus
#error You must use C++ compiler, or you need filename with '.cpp' suffix
#endif
Expand Down Expand Up @@ -1255,7 +1264,7 @@ HINSTANCE EGEAPI getHInstance();
HDC EGEAPI getHDC(PCIMAGE pImg = NULL);

PVOID EGEAPI getProcfunc();
int EGEAPI getGraphicsVer(); // 获取当前版本
long EGEAPI getGraphicsVer(); // 获取当前版本
float EGEAPI getfps(); // 获取当前帧率

//随机函数
Expand Down
18 changes: 5 additions & 13 deletions src/ege_head.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#define _ALLOW_RUNTIME_LIBRARY_MISMATCH
#endif

#define EGE_GRAPH_LIB_BUILD
#define EGE_DEPRECATE(text)
#include "ege.h"

#define EGE_TOSTR_(x) #x
#define EGE_TOSTR(x) EGE_TOSTR_(x)
Expand Down Expand Up @@ -62,16 +65,8 @@
# define COMPILER_VER_W L"GCC" GCC_VER_W SYSBITS_W
#endif

#define EGE_VERSION_YEAR "20"
#define EGE_VERSION_MONTH "08"
#define EGE_VERSION_YEAR_INT 20
#define EGE_VERSION_MONTH_INT 8

#define EGE_VERSION_INT (EGE_VERSION_YEAR_INT * 100 + EGE_VERSION_MONTH_INT)
#define EGE_VERSION EGE_VERSION_YEAR "." EGE_VERSION_MONTH
#define EGE_VERSION_W EGE_L(EGE_VERSION_YEAR) L"." EGE_L(EGE_VERSION_MONTH)
#define EGE_TITLE "EGE" EGE_VERSION " " COMPILER_VER
#define EGE_TITLE_W L"EGE" EGE_VERSION_W L" " COMPILER_VER_W
#define EGE_TITLE "EGE" EGE_VERSION " " COMPILER_VER
#define EGE_TITLE_W L"EGE" EGE_VERSION " " COMPILER_VER

#define EGE_WNDCLSNAME "Easy Graphics Engine"
#define EGE_WNDCLSNAME_W EGE_L(EGE_WNDCLSNAME)
Expand All @@ -86,9 +81,6 @@

#include <string>

#define EGE_GRAPH_LIB_BUILD
#define EGE_DEPRECATE(text)
#include "ege.h"
#include "ege/egecontrolbase.h"
#include "thread_queue.h"

Expand Down
4 changes: 2 additions & 2 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,8 @@ int getinitmode() {
}

// 鑾峰彇褰撳墠鐗堟湰
int getGraphicsVer() {
return EGE_VERSION_INT;
long getGraphicsVer() {
return EGE_VERSION_NUMBER;
}

HWND getParentHWnd() {
Expand Down
2 changes: 1 addition & 1 deletion src/graphics.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*********************************************************
* EGE (Easy Graphics Engine)
* EGE (Easy Graphics Engine) 20.08
* FileName graphics.h
* HomePage1 http://misakamm.github.com/xege
* HomePage2 http://misakamm.bitbucket.org/index.htm
Expand Down
Loading