Relfos / TERRA-Engine

Cross platform game engine written in Object Pascal.
http://www.pascalgameengine.com
Apache License 2.0
103 stars 42 forks source link

Many samples not comping on master branch #5

Closed TSGer2015 closed 9 years ago

TSGer2015 commented 9 years ago

Hi, i tried to compile your samples in 3D and many of them not compiling, missing units like TERRA_UI or TERRA_Scene, or TERRA_SpriteManager.

Samples:

I checkout master branch, "TERRA-Engine-master.zip".

It seems to be a nice engine but not usable at moment.

Best regards Thomas

PS: sorry for bad english, is not my native language

Relfos commented 9 years ago

Hi, the engine is perfectly usable (I even have a PC game in Steam that uses it). However the engine got a major refactor in the last months, not all samples were ported yet, thats why they not compile, because many units/classes changed names or got split into different classes. There's another branch called old_master were those samples can be compiled.

The most important samples are all working in the master branch though (sprites, GUI, input, mesh rendering etc), but if there's a specific sample you need tell me and I'll port it to the master branch.

On Sun, Nov 1, 2015 at 3:32 PM, TSGer2015 notifications@github.com wrote:

Hi, i tried to compile your samples in 3D and many of them not compiling, missing units like TERRA_UI or TERRA_Scene, or TERRA_SpriteManager.

  • billboard_simple.dpr
  • color_grading.dpr unknown proptery SpriteRenderer in object TERRAViewport
  • mesh_ik.dpr missing unit TERRA_UI and more
  • mesh_smoothing.dpr missing unit TERRA_UI and more
  • outline_simple.dpr missing unit TERRA_UI and more ....

I checkout master branch, "TERRA-Engine-master.zip".

It seems to be a nice engine but not usable at moment.

Best regards Thomas

PS: sorry for bad english, is not my native language

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5.

TSGer2015 commented 9 years ago

Hi,

sorry, usable was wrong statement. For getting a grip of your engine it is important to have working samples, but maybe i can find out how it works.

I try to write a game running on pandora/pyra (successor), an arm mini computer with opengl es 1.1/2.0 support.

Grettings Thomas

Relfos commented 9 years ago

Well, if you want to make games to that platform, as long as FPC supports it and it works with Open 2.0, its ok. Unless it is Android based, you will probably need to add support for it in the engine, since probably it requires custom startup/input/sound code.

Check the Engine\OS folder, you'll just need to add a new folder called Pandora, with a TERRA_OS.pas and any other custom units you need there.

On Mon, Nov 2, 2015 at 4:33 PM, TSGer2015 notifications@github.com wrote:

Closed #5 https://github.com/Relfos/TERRA-Engine/issues/5.

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#event-452170302.

TSGer2015 commented 9 years ago

Thanks for hint. It is a linux platform (Angstöm) and fpc/lazarus can cross compile to this platform. I have written an opengl es demo for it, a simple labyrinth sample, with milkshape/wavefront/MD3 loader, but with "windows 8.1" the amd "opengl es" emulation is not working any more.

TSGer2015 commented 9 years ago

Hi,

after some changes, mostly in TERRA_GLES2Renderer.pas, which has old references to "image" or "color", i can cross compile and link sprite_simple.dpr for Pandora. But starting failed, library libGL.so.1 was not found, that's correct, there is no OpenGL library on system, only OpenGL ES.

In unit TERRA_OS work i include only OpenGLESRender, but TERRA_Debug includes direct/indirect TERRA_OpenGL and this unit loads library libGL.so.1.

Is there a way to work around this behavior? Or have i miss understand something?

Thomas

Relfos commented 9 years ago

Yes, correct, Image-> TERRAImage, Color -> ColorRGBA

TERRA_Debug is not necessary at all, this is mostly for debugging OpenGL problems in desktop. What unit is including it in the compilation?

On Tue, Nov 3, 2015 at 4:33 PM, TSGer2015 notifications@github.com wrote:

Hi,

after some changes, mostly in TERRA_GLES2Renderer.pas, which has old references to "image" or "color", i can cross compile and link sprite_simple.dpr for Pandora. But starting failed, library libGL.so.1 was not found, that correct, there is no OpenGL library on system, only OpenGL ES.

In unit TERRA_OS work i include only OpenGLESRender, but TERRA_Debug includes direct/indirect TERRA_OpenGL and this unit loads library libGL.so.1.

Is there a way to work around this behavior? Or have i miss understand something?

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153408395.

TSGer2015 commented 9 years ago

Thanks for fast response.

I found it in TERRA_List, i can put

{$IFDEF DEBUG_GL} TERRA_DebugGL{$ELSE}TERRA_GL{$ENDIF};

around it, so TERRA_GL is loaded from OS directory, in my case PANDORA. I copied TERRA_GL from android directory, but this load all function statically, in TERRA_OpenGLES all function are loaded dynamically, depends on DEFINE - setting. In Windows seems to be the same, statically compiled in TERRA_GL, in TERRA_OpenGL loads dynamically. So, there two different unit for same doing. Hopefully i can explain it correkt.

Thomas

Relfos commented 9 years ago

OpenGLES can be loaded dynamically or static, because Android requires dynamic and iOS requires static, if I remember correctly.

If you want, I can add you to the contributors list, so that you send commits with those changes (and include the Pandora stuff).

On Tue, Nov 3, 2015 at 5:11 PM, TSGer2015 notifications@github.com wrote:

Thanks for fast response.

I found it in TERRA_List, i can put

{$IFDEF DEBUG_GL} TERRA_DebugGL{$ELSE}TERRA_GL{$ENDIF};

around it, so TERRA_GL is loaded from OS directory, in my case PANDORA. I copied TERRA_GL from android directory, but this load all function statically, in TERRA_OpenGLES all function are loaded dynamically, depends on DEFINE - setting. In Windows seems to be the same, statically compiled in TERRA_GL, in TERRA_OpenGL loads dynamically. So, there two different unit for same doing. Hopefully i can explain it correkt.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153420790.

TSGer2015 commented 9 years ago

If i have some functional samples, i will make a diff of my changes and send it to. if you accept it, i can commit this to the repository. I had done some changes on important units and i don't know if there all correct :)

Thomas

Relfos commented 9 years ago

Ok, that's fine. If you have more questions just tell me

On Tue, Nov 3, 2015 at 6:02 PM, TSGer2015 notifications@github.com wrote:

If i have some functional samples, i will make a diff of my changes and send it to. if you accept it, i can commit this to the repository. I had done some changes on important units and i don't know if there all correct :)

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153435791.

TSGer2015 commented 9 years ago

Hi Relfos,

it is possible to add new defines to "terra.inc"?

I want to add new defines

Thomas

Relfos commented 9 years ago

Sure, no problem,any improvements to the engine are welcome! :)

On Wed, Nov 4, 2015 at 5:21 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

it is possible to add new defines to "terra.inc"?

I want to add new defines

  • PANDORA the new system
  • HAS_DIRECTX
  • HAS_OPENGL
  • HAS_OPENGLES
  • HAS_NULLRENDER

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153797845.

TSGer2015 commented 9 years ago

Hi Relfos,

small success. Now compiling without any reference to library "libGL,so" or "opengl32.dll" if the new define HAS_OPENGL not set, TERRA_GL in OS/Windows is not included any more. I can compile with NULL-Render, no opengl stuff is included in this case.

I test some samples, sprite_simple, sprite_benchmark, clothes, picking, bloom, all this works with opengl render. Render TERRA_D3D9Renderer can not compiled, missing some changes to new render system.

Cross compiling to my pandora works, but on startup i got strange message "this binary has no dynamic library compiled in". This comes from unit dynlib, i have check my cross compiler.

Thomas

Relfos commented 9 years ago

I was thinking, in fact there should not be any need for those includes, I'm not understanding why you were getting those units included in the compilation, maybe you based your TERRA_OS on the Windows/TERRA_OS.pas?

The D3D9 renderer, OpenGL and OpenGL ES renderer should not included in any 'uses' except in TERRA_OS (which should call something like Renderers.Add(OpenGLRenderer.Create())) If some other unit did use them, it was a mistake.

Linux/TERRA_OS and OSX/TERRA_OS just include TERRA_GLRenderer Android/TERRA_OS and iOS/TERRA_OS just include TERRA_GLESRenderer Windows/TERRA_OS includes TERRA_GLRenderer (and in future will include TERRA_D3D9Rendere, which is still incomplete)

NullRenderer like you said, is useful to test compiling the code without any graphical library dependencies.

So, basically you have a different TERRA_OS per platform, and in your case you just need to add the TERRA_GLESRenderer unit in the uses list of your Pandora/TERRA_OS.pas file, and then call the function to register the renderer somewhere in the .InitSettings method of the same file. None of the other units need to be added because they dont make sense for that platform.

To explain this better, TERRA_OS should implement the OS specific code, by implement a Application class that inherits from BaseApplication (TERRA_Application.pas). The kind of stuff that neeeds to be implemented there is the following:

You should use the Linux/TERRA_OS as base, since it is the most similar. Especially the timing functions might not need changes. Also if Pandora uses a Xsystem for graphics/input, then most of the work is done.

On Wed, Nov 4, 2015 at 6:54 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

small success. Now compiling without any reference to library "libGL,so" or "opengl32.dll" if the new define HAS_OPENGL not set, TERRA_GL in OS/Windows is not included any more. I can compile with NULL-Render, no opengl stuff is included in this case.

I test some samples, sprite_simple, sprite_benchmark, clothes, picking, bloom, all this works with opengl render. Render TERRA_D3D9Renderer can not compiled, missing some changes to new render system.

Cross compiling to my pandora works, but on startup i got strange message "this binary has no dynamic library compiled in". This comes from unit dynlib, i have check my cross compiler.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153829206.

TSGer2015 commented 9 years ago

Hi Relfos,

there where some direct / indirect includes of TERRA_OpenGL

This are only small changes but at without them, TERRA_OpenGL was compiled into my binary, and this loads library libGL.so, which not exists on pandora linux.

Now i have a PANDORA/TERRA_OS without including unit GLX, this loads opengl from fpc too. I believe this can also removed from OS/Linux and unit Linux/TERRA_GL can be deleted too, but this is to be checked.

Thomas

Relfos commented 9 years ago

Ok, so you'll have to avoid getting the desktop TERRA_GLRenderer and TERRA_OpenGL to be added to the compilation.

Also the reason that I have Linux/TERRA_GL, TERRASockets and tons of other custom made bindings is mostly because I want to keep the engine compiler-agnostic (support for FPC, Delphi, Oxygene, etc) and also because some FPC units use conventions that make that very difficult (eg: declaring parameters as pointers to integers instead of just "Var bla:integer", which breaks compability with Oxygene and Pascal Smart Studio, who do not support pointers, or they like to append fp to names of functions).

On Wed, Nov 4, 2015 at 8:31 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

there where some direct / indirect includes of TERRA_OpenGL

  • TERRA_OpenGLCommon, includes from OpenGLES2Render, loads always TERRA_OpenGL if define MOBILE not set (PANDORA is not a mobile device), i change this into HAS_OPENGLES and set this define, if define MOBILE or PANDORA was defined in terra.inc.
  • in TERRA_DebugGL, but not needed in this unit, i remove this inclusion
  • TERRA_LIST includes TERRA_Debug, i remove this inclusion

This are only small changes but at without them, TERRA_OpenGL was compiled into my binary, and this loads library libGL.so, which not exists on pandora linux.

Now i have a PANDORA/TERRA_OS without including unit GLX, this loads opengl from fpc too. I believe this can also removed from OS/Linux and unit Linux/TERRA_GL can be deleted too, but this is to be checked.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-153853856.

TSGer2015 commented 9 years ago

Hi Relfos,

Small update. I can compile to arm linux. With my old cross compiler, 2.5.1, i got a x11 transparent windows on Pandora, but no egl context, and after a few seconds application terminating without interaction from me. Is there a DEFINE for debug output to console on lnux?

With my new cross (3.0rc2) it starts but terminates immediately with a segment fault, needs more investigation.

Thomas

Relfos commented 9 years ago

Welcome to the pain of ARM cross compiling with FPC.

I was unable to get the engine working in a stable way with FPC 3.0. My game loads fine, displays the main menu, but once I login it crashes with a floating point exception. First try checking if you are using a compiler with hard float compiled-in as it might be a similar problem.

Anyway, better to try getting it working first with 2.5 (or 2.7, as its the latest version I know its stable)

About debugging to console, check TERRA_Log, enable the console debug switch, I remember I've used it before in Linux, not sure if theres any difference in this platform.

Also take note that the Linux EGL context initialization code is a bit order sensitive, and I've heard reports that my game does not boot in a small percentage of Linux distros, so there might be a small bug somewhere in that code.

On Sun, Nov 8, 2015 at 1:06 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

Small update. I can compile to arm linux. With my old cross compiler, 2.5.1, i got a x11 transparent windows on Pandora, but no egl context, and after a few seconds application terminating with out interaction from me. Is there a DEFINE for debug output to console on lnux?

With my new cross (3.0rc2) it starts but terminates immediately with a segment fault, needs more investigation.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-154825585.

TSGer2015 commented 9 years ago

I'm using my old cross compiler, the new one crashed in system units of fpc.

Building fragment code for shader on Pandora fails, i got a segment fault later. If have disabled shader support with define DISABLESHADERS, but this seems to be ignored in TERRASprite, the shaders compiler is called.

Thomas

TSGer2015 commented 9 years ago

Sorry, you are creating always a minimal shader, i have to check it. Thomas

Relfos commented 9 years ago

Yes, if the shader compilation fails, a very simple shader that only outputs magenta color is loaded instead. Try to see what error says in the shader log.

On Wed, Nov 11, 2015 at 6:45 AM, TSGer2015 notifications@github.com wrote:

Sorry, you are creating always a minimal shader, i have to check it. Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-155683624.

TSGer2015 commented 9 years ago

Hi Relfos,

sorry to ask you, but where did you create an opengl es context? In TERRA_GLES2Renderer CreateContext load opengl functions, but there is no context creation, or?

glCreateShader fails on pandora, if no valid context is created before. This raise the segment fault.

Thomas

Relfos commented 9 years ago

I checked, what is happening is that in GLES I create the context in Java (Android) or Objective-C (iOS) before the Pascal code even starts. So in your case, you should add a IFDEF PANDORA to OpenGLES2Renderer.CreateContext() and put there any context initialization code you need.

On Wed, Nov 11, 2015 at 4:15 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

sorry to ask you, but where did you create an opengl es context? In TERRA_GLES2Renderer CreateContext load opengl functions, but there is no context creation, or?

glCreateShader fails on pandora, if no valid context is created before. This raise the segment fault.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-155831575.

Relfos commented 9 years ago

Any success with this?

Also can you send a pull request with the changes? I might be able to take a look this weekend.

On Wed, Nov 11, 2015 at 4:40 PM, Sergio Flores relfos@gmail.com wrote:

I checked, what is happening is that in GLES I create the context in Java (Android) or Objective-C (iOS) before the Pascal code even starts. So in your case, you should add a IFDEF PANDORA to OpenGLES2Renderer.CreateContext() and put there any context initialization code you need.

On Wed, Nov 11, 2015 at 4:15 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

sorry to ask you, but where did you create an opengl es context? In TERRA_GLES2Renderer CreateContext load opengl functions, but there is no context creation, or?

glCreateShader fails on pandora, if no valid context is created before. This raise the segment fault.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-155831575.

TSGer2015 commented 9 years ago

Hi Relfos,

no really success, i get an opengl es context, but glCreateShader raise always a segmentation fault. I have no idea why, now i write a small test program with my a self written opengl es header.

If have only done small changes, changed some lines from "Log" to "Engine.Log", or "RaiseError" to "Engine.RaiseError" , removed some not needed units from "uses" statement, but nothing really to submit.

Thomas

TSGer2015 commented 9 years ago

I have a working opengl es sample with my opengl es dynamic function loader and this works on Windows and Linux. Luckily most Names und Types are identical to TERRA_OpenGLES.pas, only removing some "T" on from my type declarations. If i use TERRA_OpenGLES.pas instead of my own unit glCreateShader raise after call an exception. This is the first called function from opengl es. So there must something with dynamic loading of opengl es functions.

Thomas

Relfos commented 9 years ago

Let me see if I understood, the only thing you changed was replacing the TERRA_OpenGLES with a another equivalent unity, everything else is the same, and you got an engine sample running?

I never tested OpenGLES on Windows or Linux, since on those OS you have acess to normal OpenGL, are you using a GLES emulator or something?

Did you check if glCreateShader() is NIL when using the TERRA_OpenGLES unit?

On Thu, Nov 19, 2015 at 6:16 PM, TSGer2015 notifications@github.com wrote:

I have a working opengl es sample with my opengl es dynamic function loader and this works on Windows and Linux. Luckily most Names und Types are identical to TERRA_OpenGLES.pas, only removing some "T" on from my type declarations. If i use TERRA_OpenGLES.pas instead of my own unit glCreateShader raise after call an exception. This is the first called function from opengl es. So there must something with dynamic loading of opengl es functions.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-158143857.

TSGer2015 commented 9 years ago

Correct, that what i have done, i can switch between your and my dynamic loader with a DEFINE - Statement, but not with an engine sample, i have a self written sample.

I'm using GLES 2.0 emulator from MALI/AMD which works in other projects without problems and only a few functions are not loaded and reported from your loader GLFunction glBlendFuncSeparate not avaliable. GLFunction glDiscardFramebuffer not avaliable. GLFunction glRenderbufferStorageMultisample not avaliable. GLFunction glResolveMultisampleFramebuffer not avaliable.

All other functions are loaded, glCreateShader is not NIL. Must be something with calling convention, but both using "cdecl;". I have no idea, whats going wrong at moment.

Thomas

Relfos commented 9 years ago

Well, I'd say, keep using your dynamic loader for now and just advance to other things.

Later either try to understand the difference yourself, or send me your loader so I can compare.

On Thu, Nov 19, 2015 at 6:41 PM, TSGer2015 notifications@github.com wrote:

Correct, that what i have done, i can switch between your and my dynamic loader with a DEFINE - Statement.

I'm using GLES 2.0 emulator from MALI/AMD which works in other projects without problems and only a few functions are not loaded and reported from your loader GLFunction glBlendFuncSeparate not avaliable. GLFunction glDiscardFramebuffer not avaliable. GLFunction glRenderbufferStorageMultisample not avaliable. GLFunction glResolveMultisampleFramebuffer not avaliable.

All other functions are loaded, glCreateShader is not NIL. Must be something with calling convention, but both using "cdecl;". I have no idea, whats going wrong at moment.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-158151156.

TSGer2015 commented 8 years ago

Hi Relfos,

i was very busy, did not come to work on this.

I changed in your TERRA_OpenGLES the calling convention for Windows by replacing all "cdec;" with "{$ifdef WIN32}stdcall;{$else}cdecl;{$endif} ", now both implementations working in my self written sample.

But i got always an error in glCreateShader in your TERRA_OpenGLCommon, seems that something before goes wrong.

Thomas

Relfos commented 8 years ago

I see, in Windows openGL always need stdcall indeed, I was thinking you were compiling directly to Linux/Pandora.

About glCreateShader, it crashes or the function just fails to create a shader? If it is the latter, there's code there to get the error from the opengl driver, what says in the log?

There are some differences between OpenGL and OpenGLES shaders. OpenGLES shaders need some precision formats for all variable declarations and OpenGL needs a #version declaration. There's code in that function that simply removes the things that are not necessary from the shader source, maybe due to a bad combination of defines the wrong things are being removed.

On Sun, Dec 6, 2015 at 10:42 AM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

i was very busy, did not come to work on this.

I changed in your TERRA_OpenGLES the calling convention for Windows by replacing all "cdec;" with "{$ifdef WIN32}stdcall;{$else}cdecl;{$endif} ", now both implementations working in my self written sample.

But i got always an error in glCreateShader in your TERRA_OpenGLCommon, seems that something before goes wrong.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-162300890.

TSGer2015 commented 8 years ago

For testing and better debugging i'm working on windows with Delphi 7 and the Mali OpenGLES Emulator.

It crashes inside glCreateShader with an EAccessViolation exception.I have found that calling any OpenGLES function in OpenGLShader.CompileShader produces the error.

If i call glCreateShader inside Sprite_Simple.MyDemo.OnRender2D at any place, i got a valid shader id, but later, it crashes. I have no idea why.

Thomas

Relfos commented 8 years ago

Try modifying terra.inc

You need something like

{$IFDEF PANDORA}{$UNDEF PC}[$ENDIF}

The "PC" define is set if the engine is compiled in Windows, OSX or Linux, for OpenGL desktop. If you undefine it, it should take the OpenGLES path.

On Sun, Dec 6, 2015 at 5:44 PM, TSGer2015 notifications@github.com wrote:

For testing and better debugging i'm working on windows with Delphi 7 and the Mali OpenGLES Emulator.

It crashes inside glCreateShader with an EAccessViolation exception.I have found that calling any OpenGLES function in OpenGLShader.CompileShader produces the error.

If i call glCreateShader inside Sprite_Simple.MyDemo.OnRender2D at any place, i got a valid shader id, but later, it crashes. I have no idea why.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-162331392.

TSGer2015 commented 8 years ago

I had already disbaled "PC".

My defines for PANDORA are: {$IFDEF PANDORA} {$UNDEF MOBILE} {$UNDEF PC} {$UNDEF WINDOWS} {$UNDEF FRAMEBUFFEROBJECTS} {$UNDEF POSTPROCESSING} {$UNDEF SHADOWMAPS}
{$DEFINE DISABLEVR} {$DEFINE CONSOLEWINDOW} {$DEFINE DISABLESHADERS} {$ENDIF}

Relfos commented 8 years ago

The DISABLESHADERS there.... try removing that. I not sure if that is something used only in older engine versions or if still has some effects.

On Sun, Dec 6, 2015 at 6:33 PM, TSGer2015 notifications@github.com wrote:

I had already disbaled "PC".

My defines for PANDORA are: {$IFDEF PANDORA} {$UNDEF MOBILE} {$UNDEF PC} {$UNDEF WINDOWS} {$UNDEF FRAMEBUFFEROBJECTS} {$UNDEF POSTPROCESSING} {$UNDEF SHADOWMAPS}

{$DEFINE DISABLEVR} {$DEFINE CONSOLEWINDOW} {$DEFINE DISABLESHADERS} {$ENDIF}

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-162334989.

TSGer2015 commented 8 years ago

Done and remove a double call of GraphicsRenderer.CreateContext(), in GraphicsRenderer.Reset() by direct calling of CreateContext() and indirect by OpenGLES2Renderer.Initialize().

I add a new "OS\SDL" - Directory, this uses SDL 1.2 for hardware abstraction and i got now a valid gles2 context on windows opengles emulator, a windows with correct background color is shown, but no sprites on it. So, have to check shader compilation, but no crashes any more.

Thomas

Relfos commented 8 years ago

Thats a nice progress, keep me posted :)

On Mon, Dec 7, 2015 at 5:35 PM, TSGer2015 notifications@github.com wrote:

Done and remove a double call of GraphicsRenderer.CreateContext(), in GraphicsRenderer.Reset() by direct calling of CreateContext() and indirect by OpenGLES2Renderer.Initialize().

I add a new "OS\SDL" - Directory, this uses SDL 1.2 for hardware abstraction and i got now a valid gles2 context on windows opengles emulator, a windows with correct background color is shown, but no sprites on it. So, have to check shader compilation, but no crashes any more.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-162602047.

TSGer2015 commented 8 years ago

Hi Relfos,

no time, no progress. I have attached my changed files,

Maybe is a good idea adding some defines like HAS_OPENGL, HAS_DIRECTX, HAS_NULLRENDER for easy switching between different renderer.

My SDL implementation is not ready, keyboard, mouse and windows management is working, but using opengl render is alway in full screen and opengles render has strange output, so not useful at moment.

Greetings Thomas

changes20151220_tse.zip

Relfos commented 8 years ago

Thanks for this, I'll test it and add to the master branch. And that defines idea is good, I'll adopt it :)

On Sun, Dec 20, 2015 at 12:42 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

no time, no progress. I have attached my changed files,

  • terra.inc - Adding HAS_OPENGLES in MOBIL-Section and SDL/Pandora defines
  • TERRA_GLES2Renderer - replace Image with TERRAImage, Color with ColorRGBA, TERRA_Log.Log with Engine.Log.Write and more
  • TERRA_OpenGLCommon - replaced {$IFDEF MOBILE} with {$IFDEF HAS_OPENGLES}
  • TERRA_OpenGLES - Made it compatible with Windows OpenGLES emulator

Maybe is a good idea adding some defines like HAS_OPENGL, HAS_DIRECTX, HAS_NULLRENDER for easy switching between different renderer.

My SDL implementation is not ready, keyboard, mouse and windows management is working, but using opengl render is alway in full screen and opengles render has strange output, so not useful at moment.

Greetings Thomas

changes20151220_tse.zip https://github.com/Relfos/TERRA-Engine/files/67798/changes20151220_tse.zip

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-166113945.

Relfos commented 8 years ago

All seems ok, I added it to the master branch.

Also if you want, I can add you to the contributors list :)

On Sun, Dec 20, 2015 at 1:04 PM, Sergio Flores relfos@gmail.com wrote:

Thanks for this, I'll test it and add to the master branch. And that defines idea is good, I'll adopt it :)

On Sun, Dec 20, 2015 at 12:42 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

no time, no progress. I have attached my changed files,

  • terra.inc - Adding HAS_OPENGLES in MOBIL-Section and SDL/Pandora defines
  • TERRA_GLES2Renderer - replace Image with TERRAImage, Color with ColorRGBA, TERRA_Log.Log with Engine.Log.Write and more
  • TERRA_OpenGLCommon - replaced {$IFDEF MOBILE} with {$IFDEF HAS_OPENGLES}
  • TERRA_OpenGLES - Made it compatible with Windows OpenGLES emulator

Maybe is a good idea adding some defines like HAS_OPENGL, HAS_DIRECTX, HAS_NULLRENDER for easy switching between different renderer.

My SDL implementation is not ready, keyboard, mouse and windows management is working, but using opengl render is alway in full screen and opengles render has strange output, so not useful at moment.

Greetings Thomas

changes20151220_tse.zip https://github.com/Relfos/TERRA-Engine/files/67798/changes20151220_tse.zip

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-166113945.

TSGer2015 commented 8 years ago

Hi Relfos,

since I have not made any real change, it is your decision. When my SDL/Pandora is working and uploaded, than you can add me.

Grettings, Thomas

Am 20.12.2015 um 21:23 schrieb Relfos:

All seems ok, I added it to the master branch.

Also if you want, I can add you to the contributors list :)

On Sun, Dec 20, 2015 at 1:04 PM, Sergio Flores relfos@gmail.com wrote:

Thanks for this, I'll test it and add to the master branch. And that defines idea is good, I'll adopt it :)

On Sun, Dec 20, 2015 at 12:42 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

no time, no progress. I have attached my changed files,

  • terra.inc - Adding HAS_OPENGLES in MOBIL-Section and SDL/Pandora defines
  • TERRA_GLES2Renderer - replace Image with TERRAImage, Color with ColorRGBA, TERRA_Log.Log with Engine.Log.Write and more
  • TERRA_OpenGLCommon - replaced {$IFDEF MOBILE} with {$IFDEF HAS_OPENGLES}
  • TERRA_OpenGLES - Made it compatible with Windows OpenGLES emulator

Maybe is a good idea adding some defines like HAS_OPENGL, HAS_DIRECTX, HAS_NULLRENDER for easy switching between different renderer.

My SDL implementation is not ready, keyboard, mouse and windows management is working, but using opengl render is alway in full screen and opengles render has strange output, so not useful at moment.

Greetings Thomas

changes20151220_tse.zip

https://github.com/Relfos/TERRA-Engine/files/67798/changes20151220_tse.zip

— Reply to this email directly or view it on GitHub

https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-166113945.

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-166151504.

TSGer2015 commented 8 years ago

Hi Relfos,

SDL and OpenGL now rendering works (samples sprite_simple, mix_test, music_player), strange effect, i got double framerate with OS/SDL/OpenGL than with OS/Windows/OpenGL :)

But with OpenGLES i see nothing. No crash, but only a empty output on Windows and Pandora. The creation of gles context is ok, shaders are compiling and linking fine and i see that method SetMat4Uniform for project and model matrix is called in every frame.

No idea, whats going wrong.

Thomas

Relfos commented 8 years ago

That's good progress!

I have a similar problem with the iOS current port, it worked before but after Apple released iOS 7 it started showing only a black screen. It is probably a bug related to OpenGL FBO, everything might be working but the final result is not being copied correctly to the window.

On Wed, Dec 23, 2015 at 12:48 PM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

SDL and OpenGL now rendering works (samples sprite_simple, mix_test, music_player), strange effect, i got double framerate with OS/SDL/OpenGL than with OS/Windows/OpenGL :)

But with OpenGLES i see nothing. No crash, but only a empty output on Windows and Pandora. The creation of gles context is ok, shaders are compiling and linking fine and i see that method SetMat4Uniform for project and model matrix is called in every frame.

No idea, whats going wrong.

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-166888449.

TSGer2015 commented 8 years ago

Hi Relfos,

i want to rename your OpenGLRender to CustomOpenGLRender, extract plattform code in OpenGLRender to OS/Windows, OS/Linux, OS/OSX and a Unit TERRA_GLRender.pas in each OS folder.

Following methods will be changed and move to each OS folder.

New Units are: Engine\Graphics\Renderer\CustomGLRender.pas Engine\OS\Windows\TERRA_OpenGLRender.pas Engine\OS\Linux\TERRA_OpenGLRender.pas Engine\OS\OSX\TERRA_OpenGLRender.pas

What do you think about it?

Thomas

Relfos commented 8 years ago

Sure, that's ok :)

On Thu, Dec 24, 2015 at 8:29 AM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

i want to rename your OpenGLRender to CustomOpenGLRender, extract plattform code in OpenGLRender to OS/Windows, OS/Linux, OS/OSX and a Unit TERRA_GLRender.pas in each OS folder.

Following methods will be changed and move to each OS folder.

  • CreateContext : Boolean;
  • DestroyContext();
  • EndFrame();

New Units are: Engine\Graphics\Renderer\CustomGLRender.pas Engine\OS\Windows\TERRA_OpenGLRender.pas Engine\OS\Linux\TERRA_OpenGLRender.pas Engine\OS\OSX\TERRA_OpenGLRender.pas

What do you think about it?

Thomas

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-167067830.

TSGer2015 commented 8 years ago

Hi Relfos,

i have attached my changes. Nothing special, for better integration of an SDL based setup, i moved TERRA_GLRender.pas into OS folders and add a new unit TERRA_GLCustomRenderer.pas.

For Linux and Windows i checked it, but i have no OSX to test it.

Thomas

Changes20151229.zip

Relfos commented 8 years ago

Thanks, the SDL option is a really nice addition :)

However I just tried it, I get a white blank screen when running the Sprite demo using SDL target for Windows (in OpenGL mode, not GLES). It might be simple to fix, I'll give it a look next weekend.

I've commited the GLCustomRenderer changes to the master branch, the SDL issues I'll wait until the problem is found/fixed.

On Tue, Dec 29, 2015 at 8:53 AM, TSGer2015 notifications@github.com wrote:

Hi Relfos,

i have attached my changes. Nothing special, for better integration of an SDL based setup, i moved TERRA_GLRender.pas into OS folders and add a new unit TERRA_GLCustomRenderer.pas.

For Linux and Windows i checked it, but i have no OSX to test it.

Thomas

Changes20151229.zip https://github.com/Relfos/TERRA-Engine/files/73791/Changes20151229.zip

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-167750074.

TSGer2015 commented 8 years ago

Ups, sorry, the SDL submitting is an error by me, i have forget to delete it. It's not complete at moment.

But, it is working on my system, i see all sprites and got around 1200 FPS on my system, nearly the same with your windows implementation.

Thomas

TSGer2015 commented 8 years ago

You have to remove TERRA_GLRenderer.pas from Graphics/Renderer, now you have two TERRA_GLRenderer.pas in unit search path.

Relfos commented 8 years ago

Yes, that fixes it, I am now able to run the demo using SDL :)

On Tue, Dec 29, 2015 at 3:51 PM, TSGer2015 notifications@github.com wrote:

You have to remove TERRA_GLRenderer.pas from Graphics/Renderer, now you have two TERRA_GLRenderer.pas in unit search path.

— Reply to this email directly or view it on GitHub https://github.com/Relfos/TERRA-Engine/issues/5#issuecomment-167817088.