Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
59 user(s) are online (45 user(s) are browsing Forums)

Members: 0
Guests: 59

more...

Support us!

Headlines

 
  Register To Post  

« 1 ... 21 22 23 (24) 25 26 27 ... 74 »
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
>sadly it means that serial debugs are not in sync with the freeze

This is some code that I use in GMAP to output debug to the screen bitmap. So there is no serial debugs or printf latency

It will need some adaptation but the idea is here


also adding some LL macros at beginning of litigious lines may help

#define LL {Libprintf("Line:%ld \n",(LONG)__LINE__);}




/*=================================================================*/
ULONG lastline=0;
struct GM_Game *GlobalG;
/*=================================================================*/
#ifdef OS3
#ifdef DOSCREENDEBUG

void OS_DrawText3(struct GM_Game *G,UBYTE *text)
{
struct OS_Screen *S;
struct RastPort *rp;
WORD x,y;

CHECK(text)
CHECK(G)
S=G->screen;
CHECK(S)
rp=S->drawrastport;
CHECK(rp)
x=S->T->rect.w/2; y=lastline;

if(lastline > (S->T->rect.h-10))
lastline=0;
lastline=lastline+10;

SetAPen(rp, 240) ;
RectFill(rp,x,y,S->T->rect.w,y+20);
SetAPen(rp, 241) ;
Move(rp,x,y);
Text(rp,(void*)text, strlen(text));
}
/*==================================================================================*/
#define PUTCHARFUNC (void (*))"\x16\xc0\x4e\x75"
void Libprintf(void *string,...)
{
va_list args;
UBYTE buffer[4096];

if(SysBase==0) return;
if(strlen(string)>1024)
return;

va_start(args, string);
RawDoFmt(string, args, PUTCHARFUNC, buffer);
va_end(args);

if(strlen(buffer)<1024)
OS_DrawText3(GlobalG,buffer);
}

#endif
#endif

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@capehill

eMail sent

It seems you are right about the interferance of the serial/debug outputs.

Furthermore it now stops at 675, wasn't able to get it to 680 (five tests)

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Raziel

LiveForIt wrote earlier that he has had some issues with DebugPrintF. It looks like I have to create 2 builds for the next release.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Yes, i followed that...if you need me to confirm some test cases, so you can add a bug report to the SDK devs, just shout

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Raziel

I need to review all debug prints in SDL2 one day. Meanwhile, I tried a simple test that did something like:

#include proto/exec.h

int main(void)
{
int i;
for (i = 0; i < 100000; i++)
{
IExec->DebugPrintF("Debugging %d\n", i);
}
return 0;
}

Can you try it, too? Fix the include line :) Above test works for me.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Works here as well

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
Just a question from a noob

Why is it
IDOS->Printf
but
IExec->DebugPrintF

Shouldn't they be consistant?

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Raziel

Since dos.library and exec.library have been developed by different persons, it could have been just a personal preference.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Ah, k, i thought it was kind of a cross-platform standard...

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Raziel

printf( const char *fmt, ..)

Is the C standard.

Printf( const char *fmt, … )

is dos.library version, but is not compatible, with C standard, %d is short, while C standard %d is int.
when using int on Printf you need to use %ld.

DebugPrintF

I agree this is mistake to use "F" at the end, it means that you have add "Debug" and change "f" to "F" when your coding.
anyway I think DebugPrintF is following the more modern standard of printf, not Printf, but I have to check docs.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
2.0.8 RC2 can be tested: https://github.com/AmigaPorts/SDL/releases

Important: default libraries don't contain debug prints anymore.

In order to see serial logs, replace SOBJS:libSDL2-2.0.so with its debug version, or in static linking scenario, link with -lSDL2_debug.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Works so far, thank you for the new update

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Capehill

sdlbenchmark on my SAM460ex with Radeon HD6570, no problems so far:
#list
SDK Dir ----rwed Hoy 23:32:43
COPYING.txt 930 ----rw-d 05-Jul-18 14:47:00
Install 629 -s--rwed Domingo 16:59:58
Install.info 18168 ----rw-d 18-Feb-18 14:54:46
README-amigaos4.md 4988 ----rwed Domingo 16:56:50
README-SDL.txt 433 ----rw-d 05-Jul-18 14:46:34
sample.bmp 69202 ----rw-d 05-Jul-18 14:46:44
sdl2benchmark 122266 ----rwed Domingo 17:04:12
#sdl2benchmark
INFO: SDL2 renderer benchmark v. 0.5 (SDL version 2.0.8)
INFO: This tool measures the speed of various 2D drawing features
INFO: Press ESC key to quit
INFO: Parameters: width 800, height 600, renderer name '(null)', iterations 100, objects 100, sleep 0
INFO: Image size 408*167
INFO: Pixel format 0x16161804 (SDL_PIXELFORMAT_RGB888)
INFO: Starting to test renderer called [compositing], flags 0xE
INFO: Points [mode: None]...100 frames drawn in 0.067 seconds => 1483.8 frames per second
INFO: Points [mode: Blend]...100 frames drawn in 0.060 seconds => 1657.1 frames per second
INFO: Points [mode: Add]...100 frames drawn in 0.060 seconds => 1677.2 frames per second
INFO: Points [mode: Mod]...100 frames drawn in 0.060 seconds => 1675.7 frames per second
INFO: Lines [mode: None]...100 frames drawn in 0.331 seconds => 302.5 frames per second
INFO: Lines [mode: Blend]...100 frames drawn in 1.825 seconds => 54.8 frames per second
INFO: Lines [mode: Add]...100 frames drawn in 1.776 seconds => 56.3 frames per second
INFO: Lines [mode: Mod]...100 frames drawn in 1.824 seconds => 54.8 frames per second
INFO: FillRects [mode: None]...100 frames drawn in 0.328 seconds => 304.9 frames per second
INFO: FillRects [mode: Blend]...100 frames drawn in 0.439 seconds => 228.0 frames per second
INFO: FillRects [mode: Add]...100 frames drawn in 0.435 seconds => 229.7 frames per second
INFO: FillRects [mode: Mod]...100 frames drawn in 0.438 seconds => 228.2 frames per second
INFO: RenderCopy [mode: None]...100 frames drawn in 0.054 seconds => 1859.9 frames per second
INFO: RenderCopy [mode: Blend]...100 frames drawn in 0.055 seconds => 1816.6 frames per second
INFO: RenderCopy [mode: Add]...100 frames drawn in 0.055 seconds => 1821.9 frames per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: RenderCopyEx [mode: None]...100 frames drawn in 0.053 seconds => 1876.5 frames per second
INFO: RenderCopyEx [mode: Blend]...100 frames drawn in 0.055 seconds => 1828.0 frames per second
INFO: RenderCopyEx [mode: Add]...100 frames drawn in 0.055 seconds => 1833.8 frames per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: Color modulation [mode: None]...100 frames drawn in 0.298 seconds => 336.0 frames per second
INFO: Color modulation [mode: Blend]...100 frames drawn in 0.302 seconds => 331.2 frames per second
INFO: Color modulation [mode: Add]...100 frames drawn in 0.296 seconds => 337.8 frames per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: Alpha modulation [mode: None]...100 frames drawn in 0.054 seconds => 1857.0 frames per second
INFO: Alpha modulation [mode: Blend]...100 frames drawn in 0.055 seconds => 1806.0 frames per second
INFO: Alpha modulation [mode: Add]...100 frames drawn in 0.053 seconds => 1896.0 frames per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: UpdateTexture [mode: None]...100 frames drawn in 0.085 seconds => 1175.5 frames per second, 1222.6 operations per second
INFO: UpdateTexture [mode: Blend]...100 frames drawn in 0.080 seconds => 1242.9 frames per second, 1292.6 operations per second
INFO: UpdateTexture [mode: Add]...100 frames drawn in 0.087 seconds => 1149.1 frames per second, 1195.1 operations per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: ReadPixels [mode: None]...0 frames drawn in 0.831 seconds => 0.0 frames per second, 120.4 operations per second
INFO: ReadPixels [mode: Blend]...0 frames drawn in 0.892 seconds => 0.0 frames per second, 112.0 operations per second
INFO: ReadPixels [mode: Add]...0 frames drawn in 0.851 seconds => 0.0 frames per second, 117.5 operations per second
INFO: [prepareTexture]Failed to set texture blend mode:
INFO: Starting to test renderer called [opengl], flags 0x2
INFO: Points [mode: None]...100 frames drawn in 0.156 seconds => 639.4 frames per second
INFO: Points [mode: Blend]...100 frames drawn in 0.156 seconds => 640.2 frames per second
INFO: Points [mode: Add]...100 frames drawn in 0.156 seconds => 642.2 frames per second
INFO: Points [mode: Mod]...100 frames drawn in 0.155 seconds => 643.2 frames per second
INFO: Lines [mode: None]...100 frames drawn in 0.458 seconds => 218.5 frames per second
INFO: Lines [mode: Blend]...100 frames drawn in 0.453 seconds => 220.5 frames per second
INFO: Lines [mode: Add]...100 frames drawn in 0.460 seconds => 217.2 frames per second
INFO: Lines [mode: Mod]...100 frames drawn in 0.453 seconds => 220.5 frames per second
INFO: FillRects [mode: None]...100 frames drawn in 1.173 seconds => 85.3 frames per second
INFO: FillRects [mode: Blend]...100 frames drawn in 1.177 seconds => 85.0 frames per second
INFO: FillRects [mode: Add]...100 frames drawn in 1.172 seconds => 85.3 frames per second
INFO: FillRects [mode: Mod]...100 frames drawn in 1.171 seconds => 85.4 frames per second
INFO: RenderCopy [mode: None]...100 frames drawn in 0.133 seconds => 749.2 frames per second
INFO: RenderCopy [mode: Blend]...100 frames drawn in 0.141 seconds => 711.7 frames per second
INFO: RenderCopy [mode: Add]...100 frames drawn in 0.141 seconds => 711.6 frames per second
INFO: RenderCopy [mode: Mod]...100 frames drawn in 0.142 seconds => 705.5 frames per second
INFO: RenderCopyEx [mode: None]...100 frames drawn in 0.136 seconds => 735.1 frames per second
INFO: RenderCopyEx [mode: Blend]...100 frames drawn in 0.140 seconds => 714.4 frames per second
INFO: RenderCopyEx [mode: Add]...100 frames drawn in 0.140 seconds => 712.9 frames per second
INFO: RenderCopyEx [mode: Mod]...100 frames drawn in 0.140 seconds => 713.5 frames per second
INFO: Color modulation [mode: None]...100 frames drawn in 0.128 seconds => 782.5 frames per second
INFO: Color modulation [mode: Blend]...100 frames drawn in 0.133 seconds => 749.5 frames per second
INFO: Color modulation [mode: Add]...100 frames drawn in 0.128 seconds => 782.9 frames per second
INFO: Color modulation [mode: Mod]...100 frames drawn in 0.128 seconds => 782.5 frames per second
INFO: Alpha modulation [mode: None]...100 frames drawn in 0.134 seconds => 748.7 frames per second
INFO: Alpha modulation [mode: Blend]...100 frames drawn in 0.137 seconds => 730.9 frames per second
INFO: Alpha modulation [mode: Add]...100 frames drawn in 0.137 seconds => 731.2 frames per second
INFO: Alpha modulation [mode: Mod]...100 frames drawn in 0.142 seconds => 704.4 frames per second
INFO: UpdateTexture [mode: None]...100 frames drawn in 0.151 seconds => 660.6 frames per second, 687.0 operations per second
INFO: UpdateTexture [mode: Blend]...100 frames drawn in 0.155 seconds => 643.7 frames per second, 669.4 operations per second
INFO: UpdateTexture [mode: Add]...100 frames drawn in 0.156 seconds => 640.2 frames per second, 665.8 operations per second
INFO: UpdateTexture [mode: Mod]...100 frames drawn in 0.155 seconds => 644.2 frames per second, 669.9 operations per second
INFO: ReadPixels [mode: None]...0 frames drawn in 1.320 seconds => 0.0 frames per second, 75.8 operations per second
INFO: ReadPixels [mode: Blend]...0 frames drawn in 1.296 seconds => 0.0 frames per second, 77.2 operations per second
INFO: ReadPixels [mode: Add]...0 frames drawn in 1.303 seconds => 0.0 frames per second, 76.8 operations per second
INFO: ReadPixels [mode: Mod]...0 frames drawn in 1.277 seconds => 0.0 frames per second, 78.3 operations per second
INFO: Failed to create renderer: Failed to create OpenGL ES 2 context
INFO: Starting to test renderer called [software], flags 0x9
INFO: Points [mode: None]...100 frames drawn in 0.582 seconds => 171.9 frames per second
INFO: Points [mode: Blend]...100 frames drawn in 0.587 seconds => 170.2 frames per second
INFO: Points [mode: Add]...100 frames drawn in 0.589 seconds => 169.8 frames per second
INFO: Points [mode: Mod]...100 frames drawn in 0.588 seconds => 170.1 frames per second
INFO: Lines [mode: None]...100 frames drawn in 0.945 seconds => 105.8 frames per second
INFO: Lines [mode: Blend]...100 frames drawn in 1.249 seconds => 80.0 frames per second
INFO: Lines [mode: Add]...100 frames drawn in 1.259 seconds => 79.5 frames per second
INFO: Lines [mode: Mod]...100 frames drawn in 1.238 seconds => 80.8 frames per second
INFO: FillRects [mode: None]...100 frames drawn in 3.234 seconds => 30.9 frames per second
INFO: FillRects [mode: Blend]...100 frames drawn in 8.404 seconds => 11.9 frames per second
INFO: FillRects [mode: Add]...100 frames drawn in 8.149 seconds => 12.3 frames per second
INFO: FillRects [mode: Mod]...100 frames drawn in 7.288 seconds => 13.7 frames per second
INFO: RenderCopy [mode: None]...100 frames drawn in 0.803 seconds => 124.6 frames per second
INFO: RenderCopy [mode: Blend]...100 frames drawn in 1.270 seconds => 78.7 frames per second
INFO: RenderCopy [mode: Add]...100 frames drawn in 1.213 seconds => 82.4 frames per second
INFO: RenderCopy [mode: Mod]...100 frames drawn in 1.176 seconds => 85.1 frames per second
INFO: RenderCopyEx [mode: None]...100 frames drawn in 7.428 seconds => 13.5 frames per second
INFO: RenderCopyEx [mode: Blend]...100 frames drawn in 2.535 seconds => 39.4 frames per second
INFO: RenderCopyEx [mode: Add]...100 frames drawn in 3.392 seconds => 29.5 frames per second
INFO: RenderCopyEx [mode: Mod]...100 frames drawn in 4.832 seconds => 20.7 frames per second
INFO: Color modulation [mode: None]...100 frames drawn in 0.682 seconds => 146.5 frames per second
INFO: Color modulation [mode: Blend]...100 frames drawn in 0.728 seconds => 137.3 frames per second
INFO: Color modulation [mode: Add]...100 frames drawn in 0.726 seconds => 137.8 frames per second
INFO: Color modulation [mode: Mod]...100 frames drawn in 0.721 seconds => 138.8 frames per second
INFO: Alpha modulation [mode: None]...100 frames drawn in 0.988 seconds => 101.2 frames per second
INFO: Alpha modulation [mode: Blend]...100 frames drawn in 1.404 seconds => 71.2 frames per second
INFO: Alpha modulation [mode: Add]...100 frames drawn in 1.361 seconds => 73.5 frames per second
INFO: Alpha modulation [mode: Mod]...100 frames drawn in 1.241 seconds => 80.6 frames per second
INFO: UpdateTexture [mode: None]...100 frames drawn in 1.015 seconds => 98.5 frames per second, 102.4 operations per second
INFO: UpdateTexture [mode: Blend]...100 frames drawn in 1.439 seconds => 69.5 frames per second, 72.3 operations per second
INFO: UpdateTexture [mode: Add]...100 frames drawn in 1.378 seconds => 72.6 frames per second, 75.5 operations per second
INFO: UpdateTexture [mode: Mod]...100 frames drawn in 1.292 seconds => 77.4 frames per second, 80.5 operations per second
INFO: ReadPixels [mode: None]...0 frames drawn in 0.133 seconds => 0.0 frames per second, 749.8 operations per second
INFO: ReadPixels [mode: Blend]...0 frames drawn in 0.130 seconds => 0.0 frames per second, 767.0 operations per second
INFO: ReadPixels [mode: Add]...0 frames drawn in 0.132 seconds => 0.0 frames per second, 756.6 operations per second
INFO: ReadPixels [mode: Mod]...0 frames drawn in 0.137 seconds => 0.0 frames per second, 728.3 operations per second
INFO: Bye bye
#

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@all

Not sure if this fits, but as it's using SDL/OpenGL i'm trying.

I have a port which i want to make work at 100%.
Right now 75% are done, missing only the OpenGL part.

This, however, compiles fine, but crashes on start.
Reason is, that an OpenGL extension is used (and available, at least in our SDK), but refuses to work from the binary.

The extenstion is GL_ARB's framebuffer and texture, added to the code with GL_GLEXT_PROTOTYPES

#include <SDL.h>
#define GL_GLEXT_PROTOTYPES
#include <SDL_opengl.h>
#include <math.h>
#include <vector>
#include "graphics.h"
#include "util.h"
#include "systemstub.h"


It's used there in the code.
This function errors out on start, right before it crashes after opening the window.

void GraphicsGL::init(int targetWint targetH) {
    
Graphics::init(targetWtargetH);
    
glBlendFunc(GL_SRC_ALPHAGL_ONE_MINUS_SRC_ALPHA);
    
glEnable(GL_BLEND);
    
glDisable(GL_DEPTH_TEST);
    
glShadeModel(GL_SMOOTH);
    const 
char *exts = (const char *)glGetString(GL_EXTENSIONS);
    const 
bool npotTex hasExtension(exts"GL_ARB_texture_non_power_of_two");
    const 
bool hasFbo hasExtension(exts"GL_ARB_framebuffer_object");
    
_backgroundTex.init();
    
_backgroundTex._npotTex npotTex;
    
_fontTex.init();
    
_fontTex._npotTex npotTex;
    
_spritesTex.init();
    
_spritesTex._npotTex npotTex;
    if (
hasFbo) {
        
setupFboFuncs();
        const 
bool err initFbo();
        if (
err) {
            
_fptr.glBindFramebuffer(GL_FRAMEBUFFER0);
        }
    } else { 
// AmigaOS 4 debug
        
error("No GL_ARB_framebuffer_object"); // AmigaOS4 debug
    
}
}


Do i have to do it differently on AmigaOS4, or are these extensions available in the SDK, but not in the gfx/3D driver?

Any help welcome

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Raziel

So where exactly the crash happens? MiniGL doesn't support frame buffer objects (FBOs).

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Somewhere in clearBuf with ABADCAFE in r2, but I can't check right now.

So FBO are a no-no?

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Raziel

Not with current MiniGL. OpenGL ES 2.0 should support FBOs: https://www.khronos.org/registry/OpenGL-Refpages/es2.0/

Regarding MiniGL:

http://www.hyperion-entertainment.biz ... s/updates-kc/src/others.c

You can query the available extensions with glGetString(GL_EXTENSIONS). It seems that your example is already doing something like that.

Does your example absolutely require the FBOs? If not, then it should be figured out why the crash happens.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Damn, so still waiting for the driver

It's possible to comment the FBO stuff out, but I would lose some functionality/support for some stuff.

Thank you for the hints

Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
>Somewhere in clearBuf with ABADCAFE in r2, but I can't check right now.

If you cant use a FBO as buffer then you cant clear it = normal.

>Damn, so still waiting for the driver

A workaround may (??) be to render in another RGB bitmap then convert this bitmap to the texture

glTexImage2D(GL_TEXTURE_2D, 0, 3, w, h, 0,GL_RGB,GL_UNSIGNED_BYTE, bitmaptr);

1) I dont know if MiniGL support changing the (rendering buffer) bitmap on the fly
2) Depending on what you render in your FBO(=bitmap) it may not works (z depth)



Go to top
Re: SDL2
Quite a regular
Quite a regular


See User information
@thellier
You can't change buffers without FBOs unfortunately, and no Warp3D driver supports that. Only the old ways work, i.e. rendering whatever you need for your "framebuffer" first, and then creating a texture from it with glGetTexImage, which you can overlay your scene with.

This is just like television, only you can see much further.
Go to top

  Register To Post
« 1 ... 21 22 23 (24) 25 26 27 ... 74 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project