Jump to content

Josh

Staff
  • Posts

    23,228
  • Joined

  • Last visited

Everything posted by Josh

  1. Josh

    Strange Error

    If anyone posts source code I can run that demonstrates an error I will try it out. Nothing has changed in the way the API works in any recent version.
  2. What graphics card do you have? It should work with everything, but I am curious.
  3. I don't actually have any problem with the addition of getters and setters, but the great thing about the API is you can generally guess what the command names are without knowing them. Sometimes in LE2, but much more often in LE3. I found myself even having to look up command names for particle emitters and some other things, so the consistent naming scheme in LE3 really helps. I don't see how getters and setters can provide a consistent API in LE3. There's exceptions I pointed out. If it were just a matter of always switching the syntax in one way or another, I would be 100% in support of them, but they are limited. It would also mean a vastly different API to document, and we're having enough trouble finishing the docs for LE2. That's why I'm suggesting the consistent documented class structure, and then implementing getters and setters in addition to that, and they can branch as far as you want from the C++ API without fear. C# users will get a documented API and will be able to follow C++ tutorials easily, and can still use the nice OO syntax, sort of like how I sometimes use operation overloading in my math code, i.e: a = b + c.Normalize(); If anyone doesn't understand the API, they can just look at the C++ docs and it will match. If they are a good C# coder, then checking out the source or additional docs won't be a problem, and they'll probably end up use getters and setters for their most commonly modified code. By providing a base API that matches C++, we can be more inclusive of the C# programmers. It's not a matter of C++ being better. I think every language except that one I made up is horrible. It's a matter of getting all the languages on roughly the same page so the community isn't branched in two development directions. C#, C++, and Lua all have a common OO structure they can share, so if it's consistent I only have to document things once. I don't just mean documentation, I mean all the tutorials and examples I put out and modify over the years. There's no way that can be duplicated and maintained because I can't even record all the changes I make and tell another person what they need to update.
  4. Yeah, but then it gets into stuff like "model.surface[1].vertex[4].position.x = 3" which looks nice, but completely branches from the original API. When I see commands, and I'm not sure what they do, that means it's getting beyond my control. There's also a problem that many of the C++ get/set functions use multiple or optional arguments, like Entity::SetPosition(x,y,z,true). So we either have a break in the design, where some things use getters/setters and some things use methods, or you have to make up your own terminology. In this case we could say: entity.position = 4 -or- entity.globalposition = 4 But it's not always that clear. Or should it be entity.localposition? That would be more consistent, but look less nice. I'm not even sure. They really should have designed getters and setters to take multiple arguments: entity.position = 4, true Without that, they're only good for some things, and it creates an awful lot of inconsistency because you still have to use a method for anything more complex. So I am still interested in C#, but I am not going to put my name behind something unless I have thoroughly examined it and decided what the API should look like, and I just don't have time right now to devote to the syntax of one language. I think the uncertainty people express over C# has less to do with me not making it official, and more to do with the issues I described here, the implication being that I would devise some kind of consistent rule to clear all that up if I were to make it official.
  5. I have provided the existing LE3 header, and am somewhat interested in C# support. I can't same more than that yet, because I don't know enough about C# to make a judgement. One problem is the getters and setters in C#, which are a nice language feature, but also lead to everyone making their own versions of commands they think is best, and it can deviate quite a lot from the original API. I would be much more comfortable with a class wrapper that duplicates the C++ classes exactly, and then let the C# people add whatever enhancement they like in a community add-on.
  6. You can safely pass uniforms that don't exist, so you can declare these in whatever shaders you need, and set them from your program without worry. Or are you saying you want these to be global values the user sets, that all shaders access?
  7. FYI, I won't do anything thats windows-only in LE3. That's one of the design rules.
  8. Well, buying the current version now gets you the option to upgrade to LE3 for an overall cost less than the price of a new LE3 license: LE2 + upgrade < LE3 license
  9. I am aiming to have the beta of LE3 for sale in 2011.
  10. The headlight parts on that car look pretty high-detail. That could be reduced a lot. I guess the physics are bouncing around a bit at first until they settle. Maybe set the mass of these things to zero until a collision occurs? That way they would just be static until something actually hits them.
  11. Delete the mesh and leave the bones, and make sure the hierarchy is the same. I don't know the specifics of doing that for any particular modeling program, but that's what you want.
  12. The le3 beta is scheduled for release sometime in 2011
  13. Leadwerks Engine 2 allows terrains up to 67 square kilometers, with a resolution of 2 meters per tile, and for whatever reason we seem to attract people who want even bigger terrains with fewer restrictions, so yes, lifting these restrictions is a priority in Leadwerks Engine 3. I don't want to make promises based on technology I have not yet invented, but I can tell you that a lot of people want the same thing as you, and that's what my goal is in the design of Leadwerks Engine 3.
  14. That's actually quite a good summary. I'm impressed.
  15. It's hard to quantify the answer to that. It's a new engine and a new start, but a lot of the design is the same. One important difference is I am using a strict naming scheme instead of making commands that individually sound nice. So instead of PositionEntity() you have SetEntityPosition(). Here's the current header file for the procedural command set: //Bank DLLExport int GetBankSize(le3::Bank* bank); DLLExport int PeekBankByte(le3::Bank* bank, int position); DLLExport char* GetBankBuffer(le3::Bank* bank); //Graphics driver DLLExport le3::OpenGL1GraphicsDriver* CreateOpenGL1GraphicsDriver(); DLLExport le3::OpenGL3GraphicsDriver* CreateOpenGL3GraphicsDriver(); DLLExport void SetGraphicsDriver(le3::GraphicsDriver* graphicsdriver); DLLExport le3::GraphicsDriver* GetGraphicsDriver(); DLLExport int GetGraphicsDriverName(le3::GraphicsDriver* graphicsdriver, char* s, int length); DLLExport int GetGraphicsDriverVendor(le3::GraphicsDriver* graphicsdriver); DLLExport int GraphicsDriverSupported(le3::GraphicsDriver* graphicsdriver); DLLExport int BuffersSupported(); //Timing DLLExport float UPS(); DLLExport int Millisecs(); DLLExport void UpdateTime(); //Network DLLExport le3::Server* CreateServer(int port); DLLExport le3::Message* UpdateServer(le3::Server* server, int timeout); DLLExport void DisconnectServer(le3::Server* server, le3::Peer* client, int force); DLLExport int SendServer(le3::Server* server, le3::Peer* client, int messageid, char* data, int size, int channel, int flags); //File system DLLExport void SetDir(const char* path); //Light DLLExport le3::DirectionalLight* CreateDirectionalLight(le3::Entity* parent); //Font DLLExport le3::Font* LoadFont(const char* path,int size,int style,int family); DLLExport void DrawFontText(le3::Font* font, char* text,int x,int y, float kerning); DLLExport int GetFontTextWidth(le3::Font* font,char* text); DLLExport int GetFontHeight(le3::Font* font); DLLExport void FreeFont(le3::Font* font); //Drawing DLLExport void SetViewport(int x, int y, int width, int height); DLLExport void SetColor(float r, float g, float b, float a); DLLExport void SetClearColor(float r, float g, float b, float a); DLLExport void SetBlendMode(int blendmode); DLLExport void DrawLine(int x0, int y0, int x1, int y1); DLLExport void DrawRect(int x, int y, int width, int height, int style); DLLExport void DrawImage(le3::Texture* image, int x, int y, int width, int height); DLLExport void TileImage(le3::Texture* image); DLLExport void SetRotation(float rotation); DLLExport void SetTranslation(float x, float y); DLLExport void SetScale(float x, float y); //Window DLLExport le3::Window* CreateWindow(const char* title,int width,int height,int style); DLLExport le3::Window* CreateCustomWindow(HWND hwnd); DLLExport int GetWindowWidth(le3::Window* window); DLLExport int GetWindowHeight(le3::Window* window); DLLExport void SetWindowShape(le3::Window* window, int x, int y, int width, int height); DLLExport void FreeWindow(le3::Window* window); //Context DLLExport le3::Context* CreateContext(le3::Window* window,int multisamplemode); DLLExport void SwapContext(le3::Context* context, int sync); //AssetReference DLLExport le3::MediaReference* FindAssetReference(char* s); DLLExport int ReloadAssetReference(le3::MediaReference* assetreference, int flags); DLLExport void SetAssetReferenceName(le3::MediaReference* assetreference, char* name); //DLLExport int CountAssetReferences(); //DLLExport le3::MediaReference* GetAssetReference(int n); //DLLExport int GetAssetReferenceName(le3::MediaReference* assetreference); //DLLExport int CountAssetReferenceInstances(le3::MediaReference* assetreference); //Asset DLLExport int GetAssetName(le3::Media* asset, char* s, int length); DLLExport le3::MediaReference* GetAssetAssetReference(le3::Media* asset); DLLExport int ReloadAsset(le3::Media* asset, int flags); //Shader DLLExport le3::Shader* CreateShader(); DLLExport le3::Shader* LoadShader(char* path, int flags); DLLExport void SetShader(le3::Shader* shader); //DLLExport int ReloadShader(le3::Shader* shader, int flags); DLLExport int SetShaderFloat(le3::Shader* shader, char* name, float f); DLLExport int SetShaderVec2(le3::Shader* shader, char* name, float x, float y); DLLExport int SetShaderVec3(le3::Shader* shader, char* name, float x, float y, float z); DLLExport int SetShaderVec4(le3::Shader* shader, char* name, float x, float y, float z, float w); DLLExport int SetShaderMat4(le3::Shader* shader, char* name, le3::Mat4* mat); DLLExport void FreeShader(le3::Shader* shader); DLLExport int GetShaderSource(le3::Shader* shader, int shaderid, char* s, int length); DLLExport int GetShaderError(le3::Shader* shader, char* s, int length); DLLExport void SetShaderSource(le3::Shader* shader, char* source, int shaderid); DLLExport int CompileShader(le3::Shader* shader, int shaderid); DLLExport int LinkShader(le3::Shader* shader); //Texture DLLExport int GetTextureTarget(le3::Texture* texture); DLLExport le3::Texture* LoadTexture(char* path, int flags); DLLExport le3::Texture* CreateTexture(int width, int height, int format, int flags, int frames); //DLLExport void LockTexture(le3::Texture* texture, int miplevel, int framenumber); //DLLExport void UnlockTexture(le3::Texture* texture, int miplevel, int framenumber); //DLLExport void WriteTexturePixel(le3::Texture* texture, int x, int y, int r, int g, int b, int a, int miplevel, int framenumber); //DLLExport int ReadTexturePixel(le3::Texture* texture, int x, int y, int miplevel, int framenumber); DLLExport void GetTexturePixels(le3::Texture* texture, char* buf, int miplevel, int framenumber, int cubeface); DLLExport void SetTexturePixels(le3::Texture* texture, char* buf, int miplevel, int framenumber, int cubeface); DLLExport int GetTextureWidth(le3::Texture* texture, int miplevel); DLLExport int GetTextureHeight(le3::Texture* texture, int miplevel); DLLExport void FreeTexture(le3::Texture* texture); DLLExport void SetTextureFilter(le3::Texture* texture, int filter); //DLLExport int TextureLocked(le3::Texture* texture, int miplevel, int framenumber); //DLLExport int ReloadTexture(le3::Texture* texture, int flags); DLLExport void BindTexture(le3::Texture* texture, int index); DLLExport char* GetTextureData(le3::Texture* texture, int miplevel, int framenumber); DLLExport int CountTextureMipmaps(le3::Texture* texture); DLLExport int GetTextureFormat(le3::Texture* texture); DLLExport int GetTextureMipmapSize(le3::Texture* texture, int mipmap); DLLExport void SetTextureClampMode(le3::Texture* texture, int x, int y, int z); DLLExport int GetTextureClampMode(le3::Texture* texture, int axis); DLLExport float GetTextureAnisotropy(le3::Texture* texture); DLLExport void SetTextureAnisotropy(le3::Texture* texture, float anisotropy); //Material DLLExport int MaterialContainsValue(le3::Material* material, const char* name); DLLExport void SetMaterialShader(le3::Material* material, le3::Shader* shader); DLLExport le3::Material* LoadMaterial(const char* path, int flags); DLLExport le3::Texture* GetMaterialTexture(le3::Material* material, int index); DLLExport void SetMaterialTexture(le3::Material* material, le3::Texture* texture, int index); //DLLExport int ReloadMaterial(le3::Material* material, int flags); DLLExport le3::Shader* GetMaterialShader(le3::Material* material); DLLExport void FreeMaterial(le3::Material* material); DLLExport void SetMaterialBlendMode(le3::Material* material, int mode); DLLExport int GetMaterialBlendMode(le3::Material* material); DLLExport void SetMaterialBackFaceCullMode(le3::Material* material, int mode); DLLExport int GetMaterialBackFaceCullMode(le3::Material* material); DLLExport void SetMaterialShadowMode(le3::Material* material, int mode); DLLExport int GetMaterialShadowMode(le3::Material* material); DLLExport void SetMaterialDepthTestMode(le3::Material* material, int mode); DLLExport int GetMaterialDepthTestMode(le3::Material* material); DLLExport void SetMaterialZSortMode(le3::Material* material, int mode); DLLExport int GetMaterialZSortMode(le3::Material* material); DLLExport void SetMaterialFloat(le3::Material* material, char* name, float x); DLLExport void SetMaterialVec2(le3::Material* material, char* name, float x, float y); DLLExport void SetMaterialVec3(le3::Material* material, char* name, float x, float y, float z); DLLExport void SetMaterialVec4(le3::Material* material, char* name, float x, float y, float z, float w); DLLExport float GetMaterialFloat(le3::Material* material, char* name); DLLExport void GetMaterialVec4(le3::Material* material, char* name, le3::Vec4* v); //Buffer DLLExport void GetBufferPixels(le3::Buffer* buffer, char* buf, int component); DLLExport void SetBuffer(le3::Buffer* buffer); DLLExport le3::Buffer* GetBuffer(); DLLExport int GetBufferWidth(le3::Buffer* buffer); DLLExport int GetBufferHeight(le3::Buffer* buffer); DLLExport le3::Buffer* CreateBuffer(int width, int height, int colortextures, int depthtexture, int multisamplemode); DLLExport le3::Texture* GetBufferColorTexture(le3::Buffer*, int index); DLLExport le3::Texture* GetBufferDepthTexture(le3::Buffer*); DLLExport void ClearBuffer(le3::Buffer* buffer, int mode); DLLExport void FreeBuffer(le3::Buffer* buffer); //World DLLExport le3::World* CreateWorld(); DLLExport void RenderWorld(); DLLExport void SetWorld(le3::World* world); DLLExport le3::World* GetWorld(); DLLExport void FreeWorld(le3::World* world); DLLExport void SetWorldAmbientLight(le3::World* world, float r, float g, float b, float a); //Entity DLLExport void SetEntityPosition(le3::Entity* entity,float x, float y, float z, int global); DLLExport void SetEntityRotation(le3::Entity* entity,float x, float y, float z, int global); DLLExport void GetEntityPosition(le3::Entity* entity, le3::Vec3* position, int global); DLLExport void GetEntityRotation(le3::Entity* entity, le3::Vec3* rotation, int global); DLLExport void GetEntityMatrix(le3::Entity* entity, le3::Mat4* mat); DLLExport void MoveEntity(le3::Entity* entity,float x, float y, float z, int global); DLLExport void TurnEntity(le3::Entity* entity,float x, float y, float z, int global); DLLExport void SetEntityMaterial(le3::Entity* entity, le3::Material* material); DLLExport le3::Material* GetEntityMaterial(le3::Entity* entity); DLLExport void GetEntityAABB(le3::Entity* entity, le3::AABB* aabb, int mode); DLLExport void FreeEntity(le3::Entity* entity); DLLExport void HideEntity(le3::Entity* entity); DLLExport void ShowEntity(le3::Entity* entity); DLLExport int CountEntityChildren(le3::Entity* entity); DLLExport le3::Entity* GetEntityChild(le3::Entity* entity, int n); DLLExport void SetEntityParent(le3::Entity* entity, le3::Entity* parent, int global); DLLExport void AlignEntityToVector(le3::Entity* entity, float x, float y, float z, int axis, float rate, float roll); //Pivot DLLExport le3::Pivot* CreatePivot(le3::Entity* parent); //Model DLLExport le3::Model* LoadModel(const char* path, int flags); DLLExport le3::Model* CreateModelSphere(int segments); DLLExport le3::Model* CreateCube(le3::Entity* parent); DLLExport void FlipModelNormals(le3::Model* model); //Camera DLLExport le3::Camera* CreateCamera(le3::Entity* parent); DLLExport void SetCameraRange(le3::Camera* camera, float nearrange, float farrange); DLLExport void GetCameraRange(le3::Camera* camera, le3::Vec2* range); DLLExport void SetCameraProjectionMode(le3::Camera* camera, int projectionmode); DLLExport int GetCameraProjectionMode(le3::Camera* camera); DLLExport void SetCameraClearColor(le3::Camera* camera, float r, float g, float b, float a); DLLExport void GetCameraClearColor(le3::Camera* camera, le3::Vec4* color); DLLExport void SetCameraZoom(le3::Camera* camera, float zoom); DLLExport float GetCameraZoom(le3::Camera* camera); DLLExport void SetCameraDrawMode(le3::Camera* camera, int drawmode); DLLExport void SetCameraFOV(le3::Camera* camera, float fov); DLLExport float GetCameraFOV(le3::Camera* camera); DLLExport void SetCameraMotionBlurMode(le3::Camera* camera, int mode); DLLExport void SetCameraViewport(le3::Camera* camera, float x, float y, float width, float height); DLLExport void GetCameraViewport(le3::Camera* camera, le3::Vec4* viewport);
  16. Leadwerks Engine 2 is written in BlitzMax, and happens to use an object-oriented design internally, not that it makes any difference. The DLL uses a procedural C interface because even different C++ compilers don't make compatible OO libs, much less OO libs for other languages. (The LE2 DLL is actually built with GCC, by the way.) Leadwerks Engine 3 is being written in C++ and will include a static lib with access to the engine classes, for use with C++. However, the compiled DLL will still use a procedural interface, for the same reasons LE2 does; there's no such thing as cross-language OO classes. In LE3, the only way to access the original object-oriented classes of a C++ library will be to import the static library into a C++ program. This is true of any library. There are other things you can do, like create a class wrapper in whatever language and make them call the procedural commands, but C++ is the only way to directly access them. If a wrapper is done right, it will make no difference to the programmer, and they can just happily call object-oriented classes without caring about the underlying design. I have not decided yet if a class wrapper will be provided for C#, but we do get requests for supporting that language more than any other.
  17. That's strange, I just tried uploading your .doc file and it worked fine.
  18. It doesn't bother me, but if you want it private you can post it in the advanced discussion forum. The file was "unapproved", not deleted, so if you need to download it again it's still available. Not sure if it will show up for you or not, but it's on the server.
  19. He won't be able to view it there. Please post it in the forum, not the code downloads section. I'll have the documentation database back up ASAP.
  20. That would be really cool.
  21. I just won't go there. I'm the staff, I can't point out the obvious joke here...
  22. Josh

    Low FPS

    That seems quite low for 332 entities, but i can't tell anything else without examining the actual file in question,
  23. I know you like the idea of programming with a visual designer, and it's a cool idea, but I don't think the outcome would be as good for my users. I think complex behaviors should be programmed and then combined and linked visually. I'm sure we'll learn more as time goes on and we see these systems in action.
  24. It might be possible to make Lua automatically execute all outputs when a certain function is called. Otherwise, you'll just have something like this at the end of the Open() function: CallOutputs("Open") This can be extended in the future to take function arguments. The flowgraph isn't really about programming though, it's about connecting objects to make events occur.
×
×
  • Create New...