mrtrizer / flappyengine Goto Github PK
View Code? Open in Web Editor NEWFlappyEngine is a component-based 2d game engine written in C++ and Js in early stage of development.
FlappyEngine is a component-based 2d game engine written in C++ and Js in early stage of development.
Now z-sort is call every render. To avoid this, I can keep Views in order until they are changed.
You can subscribe to Connected/Disconnected and Update methods in constructor of Component.
Such component will simplify code of emiting event from View to Controller.
GLViewManager -> GLRenderManager
View -> RenderObject
GLCircleView -> GLCircleRenderObject
Take a look at SpriteComponent and other view components.
It's useful field for engine tests.
For example:
config.json
"name":"Flappy",
"defines":["RELEASE"]
config_debug.json
"defines":["DEBUG"]
Than command flappy prebuild cmake debug
will give you next result:
"name":"Flappy",
"defines":["DEBUG"]
Consider this
Grayscale
GrayscaleAlpha
RGB24
RGB32
This should solve problems with object transport. Entities become untied of EntityManager.
When entity is added to EntityManager hierarchy and get access to ManagerList, we should send a Connected event to connected subtree. Optionally we can also pass managerList in this event. When subtree is disconnected, all children get Disconnected event. Presenter components use this events to create/remove renders.
SomeComponent::SomeComponent() {
on([this](Connected e) {
...
});
on([this](Disconnected e) {
});
on([this](Update e) {
});
}
(I realised that such code can't work, because all components of entity will get this events at same time. Thus I can't call Connected event on component creation.)
Also this code can be placed in Component base class and usual virtual connected()/disconnected()/init() methods could be called.
Finally, this approach can help us to simplify entity-component tree.
To provide necessary methods for entity manipulation, we can create common parent class for EntityManager and Entity.
About memory safety. We can create temporary entity for component in Component constructor. So we can use entity() method in component constructor without crashes. This temporary entity will be removed when component is added to another entity. If programmer added some components to temprorary entity they also will be removed.
Would be cool to create TypeId class, containing base class id apart of id itself in order check it on assigning and in TypeMap.
May be even move IResFactory class to a separate file
New name better describes purpose of the class. It contains sprite rect in atlas and sprite size.
Something simple and flexible. Remember how it's hard to debug box2d raycasting.
Kinda of: {!name|DefaultName!}
Idea for names:
It's useful for internal engine tests.
May be even use abstraction to support future physics engines.
Check complex dependency cases.
Check component dependency.
After little exploration I found a solution. For compilation to HLSL and MSL I could use glslang + SPIRV-Cross. So, seems, I need not worry about this currently and just continue work with GLSL.
Fragment shader compilation from GLSL to GLSL ES and HLSL:
glslangValidator -H -V -o test.spv shaders-hlsl/frag/basic.frag
./spirv-cross --hlsl-enable-compat --hlsl --shader-model 51 --entry main test.spv
./spirv-cross --version 310 --es test.spv
Could be useful to use in exception throwing.
This will solve problems with object depending.
Also rename View to Render
Camera should be able to render into a framebuffer. Framebuffer should be accessible as a texture.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.