add jes.h, Core, and Runtime
This commit is contained in:
parent
c19ea4e1b0
commit
83553e78f1
@ -25,7 +25,8 @@ task :gui => :library do
|
||||
base_env.clone(clone: :all) do |env|
|
||||
env.parse_flags!("!sdl2-config --cflags --libs")
|
||||
env.parse_flags!("!freetype-config --cflags --libs")
|
||||
env["LIBS"] += ["dl"]
|
||||
env["LIBPATH"] += ["lib"]
|
||||
env["LIBS"] += ["dl", "jes"]
|
||||
if RUBY_PLATFORM =~ /mingw/
|
||||
env["LIBS"] += ["opengl32"]
|
||||
else
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include <iostream>
|
||||
#include "GUI.h"
|
||||
|
||||
#include "jes.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
15
src/lib/include/jes.h
Normal file
15
src/lib/include/jes.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef JES_H
|
||||
#define JES_H
|
||||
|
||||
#include "jes/Core.h"
|
||||
#include "jes/Ref.h"
|
||||
|
||||
namespace jes
|
||||
{
|
||||
void JES_Init(const std::string & bin_path)
|
||||
{
|
||||
Core::instance.init(bin_path);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
23
src/lib/include/jes/Core.h
Normal file
23
src/lib/include/jes/Core.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef JES_CORE_H
|
||||
#define JES_CORE_H
|
||||
|
||||
#include "jes/Ref.h"
|
||||
#include <string>
|
||||
|
||||
namespace jes
|
||||
{
|
||||
typedef Ref<std::string> StringRef;
|
||||
|
||||
class Core
|
||||
{
|
||||
public:
|
||||
static Core instance;
|
||||
|
||||
void init(const std::string & bin_path);
|
||||
|
||||
protected:
|
||||
std::string m_bin_path;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
21
src/lib/include/jes/Runtime.h
Normal file
21
src/lib/include/jes/Runtime.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef JES_RUNTIME_H
|
||||
#define JES_RUNTIME_H
|
||||
|
||||
#include "jes/Core.h"
|
||||
|
||||
namespace jes
|
||||
{
|
||||
class Runtime
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
FONT,
|
||||
SHADER,
|
||||
COUNT,
|
||||
};
|
||||
static StringRef locate(int type, const std::string & name);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
11
src/lib/src/Core.cc
Normal file
11
src/lib/src/Core.cc
Normal file
@ -0,0 +1,11 @@
|
||||
#include "jes/Core.h"
|
||||
|
||||
namespace jes
|
||||
{
|
||||
Core Core::instance;
|
||||
|
||||
void Core::init(const std::string & bin_path)
|
||||
{
|
||||
m_bin_path = bin_path;
|
||||
}
|
||||
}
|
14
src/lib/src/Runtime.cc
Normal file
14
src/lib/src/Runtime.cc
Normal file
@ -0,0 +1,14 @@
|
||||
#include "jes/Runtime.h"
|
||||
|
||||
namespace jes
|
||||
{
|
||||
static const char * const runtime_directories[Runtime::COUNT] = {
|
||||
"fonts",
|
||||
"shaders",
|
||||
};
|
||||
|
||||
StringRef Runtime::locate(int type, const std::string & name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user