Skip to content

Commit

Permalink
Merge pull request #143 from yixy-only/feature_add_version
Browse files Browse the repository at this point in the history
Feature: 公开头文件中加入版本宏
  • Loading branch information
yixy-only authored Feb 3, 2024
2 parents a6231b0 + 9ab95ab commit 42a3c65
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
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

0 comments on commit 42a3c65

Please sign in to comment.