wont use lua lol
This commit is contained in:
parent
2577b18b43
commit
1c27658641
15 changed files with 101 additions and 26 deletions
|
|
@ -21,11 +21,17 @@ set_target_properties(enginend PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}"
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}"
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/link/${CURRPLATFORM}"
|
||||||
)
|
)
|
||||||
|
target_include_directories(enginend PUBLIC
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_executable(test test.cpp)
|
add_executable(test test.cpp)
|
||||||
|
|
||||||
|
|
||||||
set_target_properties(test PROPERTIES
|
set_target_properties(test PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/engine/test"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/engine/test"
|
||||||
)
|
)
|
||||||
|
|
@ -39,7 +45,14 @@ target_link_libraries(test PRIVATE
|
||||||
target_include_directories(test PUBLIC
|
target_include_directories(test PUBLIC
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
)
|
)
|
||||||
target_include_directories(enginend PUBLIC
|
add_executable(noisemake test.cpp)
|
||||||
${CMAKE_SOURCE_DIR}/include
|
set_target_properties(noisemake PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/engine/noisedev"
|
||||||
)
|
)
|
||||||
|
target_include_directories(noisemake PUBLIC
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
|
target_link_libraries(noisemake PRIVATE
|
||||||
|
enginend
|
||||||
|
raylib
|
||||||
|
)
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include <enginend/engine.h>
|
#include <enginend/engine.h>
|
||||||
#include <enginend/graph/noise.h>
|
#include <enginend/graph/noise.h>
|
||||||
#include <luajit/lua.hpp>
|
|
||||||
#include <tiny/tdf.h>
|
#include <tiny/tdf.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,7 +17,9 @@ public:
|
||||||
std::vector<std::string> scripts;
|
std::vector<std::string> scripts;
|
||||||
const char* CONF()override{return "scripts.tdf";}
|
const char* CONF()override{return "scripts.tdf";}
|
||||||
Image noiseout;
|
Image noiseout;
|
||||||
|
std::string erroredscript="";
|
||||||
noiserenderer(){
|
noiserenderer(){
|
||||||
|
enginend::DEFAULT->text={255,0,0,255};
|
||||||
config=new tiny::TDF_FILE;
|
config=new tiny::TDF_FILE;
|
||||||
config->filepath=(char*)this->CONF();
|
config->filepath=(char*)this->CONF();
|
||||||
config->read();
|
config->read();
|
||||||
|
|
@ -40,18 +41,24 @@ public:
|
||||||
this->tickrate=3;
|
this->tickrate=3;
|
||||||
this->framerate=3;
|
this->framerate=3;
|
||||||
}
|
}
|
||||||
void tick() override{}
|
void tick() override {
|
||||||
void draw() override {
|
(*(dynamic_cast<enginend::nodes::twod::text*>((*gui)[1]))).content=this->erroredscript;
|
||||||
|
(*(dynamic_cast<enginend::nodes::twod::text*>((*gui)[0]))).tick();
|
||||||
|
(*(dynamic_cast<enginend::nodes::twod::text*>((*gui)[1]))).tick();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void draw() override {
|
||||||
|
(*(dynamic_cast<enginend::nodes::twod::text*>((*gui)[0]))).draw();
|
||||||
|
(*(dynamic_cast<enginend::nodes::twod::text*>((*gui)[1]))).draw();
|
||||||
|
}
|
||||||
void exit() override{}
|
void exit() override{}
|
||||||
~noiserenderer() {};
|
~noiserenderer() {};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void refreshstuf(noiserenderer *program,char *refreshtdf,char *refreshnoise);
|
void refreshstuf(noiserenderer *program,char *refreshtdf,char *refreshnoise);
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
noiserenderer program;
|
noiserenderer program;
|
||||||
program.boot();
|
program.boot();
|
||||||
struct timespec peepy;
|
struct timespec peepy;
|
||||||
|
|
@ -115,4 +122,4 @@ void refreshstuf(noiserenderer *program,char *refreshtdf,char *refreshnoise){
|
||||||
delete tocheck;
|
delete tocheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
40
engine/noisedev/noise.h
Normal file
40
engine/noisedev/noise.h
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct buffer {
|
||||||
|
char**pixel;//rgba format
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum NOISETYPE {
|
||||||
|
CLOUD,
|
||||||
|
RANDOM,
|
||||||
|
|
||||||
|
};
|
||||||
|
enum DIMENSION {
|
||||||
|
ONE,TWO,THREE,FOUR
|
||||||
|
};
|
||||||
|
|
||||||
|
class noise {
|
||||||
|
public:
|
||||||
|
int freq;
|
||||||
|
int octave;
|
||||||
|
int amp;
|
||||||
|
NOISETYPE type;
|
||||||
|
DIMENSION dims;
|
||||||
|
|
||||||
|
noise(int freq,int octave, int amp, NOISETYPE type, DIMENSION dims):
|
||||||
|
freq(freq), octave(octave), amp(amp), type(type),dims(dims) {
|
||||||
|
|
||||||
|
}
|
||||||
|
/// to explain the image generator
|
||||||
|
/// \param x int
|
||||||
|
/// \param y int
|
||||||
|
/// ^ these here is the position the noise will start rendering
|
||||||
|
/// \param w
|
||||||
|
/// \param h
|
||||||
|
/// these are the image width and height. PLEASE DO NOT GET CONFUSED
|
||||||
|
buffer* gen(short w, short h,int x, int y);
|
||||||
|
};
|
||||||
|
|
||||||
|
buffer* cloud(noise* noise,short w, short h,int x, int y);
|
||||||
|
buffer* random(noise* noise, short w, short h,int x, int y);
|
||||||
10
engine/noisedev/noises/random.cpp
Normal file
10
engine/noisedev/noises/random.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include "../noise.h"
|
||||||
|
|
||||||
|
class noiserandom:public noise {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
noiserandom* createnoise() {
|
||||||
|
noiserandom* neo=new noiserandom();
|
||||||
|
return neo;
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
{ lua
|
|
||||||
" CLOUD cloud.lua
|
|
||||||
" NOISE noise.lua
|
|
||||||
}
|
|
||||||
i refreshsecs 3
|
i refreshsecs 3
|
||||||
i tdfrefresh 5
|
i tdfrefresh 5
|
||||||
i imagesize 512
|
i imagesize 512
|
||||||
|
|
||||||
|
{ lua
|
||||||
|
" CLOUD cloud
|
||||||
|
" NOISE noise
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Image* noise::gen(short w, short h, int x, int y) {
|
Image* noise::gen(short w, short h, int x, int y) {
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
case CLOUD:
|
case CLOUD:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "window.h"
|
|
||||||
|
struct buffer {
|
||||||
|
char**pixel;//rgba format
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
enum NOISETYPE {
|
enum NOISETYPE {
|
||||||
CLOUD,
|
CLOUD,
|
||||||
RANDOM,
|
RANDOM,
|
||||||
|
|
@ -16,8 +21,11 @@ class noise {
|
||||||
int amp;
|
int amp;
|
||||||
NOISETYPE type;
|
NOISETYPE type;
|
||||||
DIMENSION dims;
|
DIMENSION dims;
|
||||||
|
|
||||||
noise(int freq,int octave, int amp, NOISETYPE type, DIMENSION dims):
|
noise(int freq,int octave, int amp, NOISETYPE type, DIMENSION dims):
|
||||||
freq(freq), octave(octave), amp(amp), type(type),dims(dims) {}
|
freq(freq), octave(octave), amp(amp), type(type),dims(dims) {
|
||||||
|
|
||||||
|
}
|
||||||
/// to explain the image generator
|
/// to explain the image generator
|
||||||
/// \param x int
|
/// \param x int
|
||||||
/// \param y int
|
/// \param y int
|
||||||
|
|
@ -25,8 +33,8 @@ class noise {
|
||||||
/// \param w
|
/// \param w
|
||||||
/// \param h
|
/// \param h
|
||||||
/// these are the image width and height. PLEASE DO NOT GET CONFUSED
|
/// these are the image width and height. PLEASE DO NOT GET CONFUSED
|
||||||
Image* gen(short w, short h,int x, int y);
|
buffer* gen(short w, short h,int x, int y);
|
||||||
};
|
};
|
||||||
|
|
||||||
Image* cloud(noise* noise,short w, short h,int x, int y);
|
buffer* cloud(noise* noise,short w, short h,int x, int y);
|
||||||
Image* random(noise* noise, short w, short h,int x, int y);
|
buffer* random(noise* noise, short w, short h,int x, int y);
|
||||||
|
|
@ -13,10 +13,10 @@ public:
|
||||||
InitWindow(500,500,"test");
|
InitWindow(500,500,"test");
|
||||||
SetTargetFPS(GetMonitorRefreshRate(GetCurrentMonitor()));
|
SetTargetFPS(GetMonitorRefreshRate(GetCurrentMonitor()));
|
||||||
this->tickrate=GetMonitorRefreshRate(GetCurrentMonitor());
|
this->tickrate=GetMonitorRefreshRate(GetCurrentMonitor());
|
||||||
s.nodes=std::list<nodes::node*>{
|
s.nodes=std::vector<nodes::node*>{
|
||||||
|
|
||||||
new nodes::colored(Color{255,255,255,255},0,0,500,500),
|
new nodes::twod::colored(Color{255,255,255,255},0,0,500,500),
|
||||||
new nodes::textfield(nullptr,enginend::DEFAULT
|
new nodes::twod::textfield(nullptr,enginend::DEFAULT
|
||||||
,100,100,220,32,32,
|
,100,100,220,32,32,
|
||||||
"welcome to enginend!\n"
|
"welcome to enginend!\n"
|
||||||
"hehe"
|
"hehe"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../lib/luajit/inc/lauxlib.h
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../lib/luajit/inc/lua.h
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../lib/luajit/inc/lua.hpp
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../lib/luajit/inc/luaconf.h
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
../../lib/luajit/inc/lualib.h
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 5db4b03aeaf0f72eb817b468461b896466f820fd
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue