GLBasic forum

Main forum => GLBasic - en => Topic started by: Kyo on 2014-Aug-25

Title: Error with Mac APP
Post by: Kyo on 2014-Aug-25
Hi,
I compiled my game for Mac (both X86 and uni) and after 1 Month of Test I have always the same error.....
In Win 7/8/8.1 and Android the game work fine.

This is my configuration:
osx Mavericks 10.9.4 Niresh
Processore Intel® Core™ i7-3630QM di 3a gen. with Intel® Turbo Boost Technology 2.0
Hard disk 500 GB
4,096 (1x) MB, DDR3 RAM (1,600 MHz)
AMD Radeon HD 7670M (2GB memory)

I test with game downloaded from iTunes, and all game works fine!
I test a simple demo of GLB and work fine.

I have in my code:
- SETSCREEN 1366,768,FALSE
- Z Project - universal screen size scaling system
- This Code
Code (glbasic) Select

IMPORT "C" void __stdcall glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S%                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T%                                  = 0x2803
 


This is the Mac report error

Code (glbasic) Select

Process:         MacOSX [665]
Path:            /Users/USER/Desktop/CC.app/Contents/MacOS/MacOSX
Identifier:      com.xxxxxxxxxx.su
Version:         0.001.0 (0.001.0)
Code Type:       X86 (Native)
Parent Process:  launchd [155]
Responsible:     MacOSX [665]
User ID:         501

Date/Time:       2014-08-25 20:36:38.454 +0200
OS Version:      Mac OS X 10.9.4 (13E28)
Report Version:  11
Anonymous UUID:  837315DB-9B27-D1B8-3358-C3D336BA4671


Crashed Thread:  1

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Thread 0:: Dispatch queue: com.apple.main-thread
0   dyld                          0x8feaa322 misaligned_stack_error + 0
1   com.xxxxxxxxxx.su          0x000b2662 OpenGLRainbows::PolyEnd() + 28
2   com.xxxxxxxxxx.su          0x00065396 __GLBASIC__::ENDPOLY() + 26
3   com.xxxxxxxxxx.su          0x00047cd8 __GLBASIC__::z_drawstage(int, int, int, double, double, double, double, double, double, double) + 680
4   com.xxxxxxxxxx.su          0x0004f916 __GLBASIC__::Update_Logo_samp() + 182
5   com.xxxxxxxxxx.su          0x00006600 __GLBASIC__::__MainGameSub_() + 2560
6   com.xxxxxxxxxx.su          0x0008d8d7 SDL_main + 817
7   com.xxxxxxxxxx.su          0x000633a0 -[SDLMain applicationDidFinishLaunching:] + 88
8   com.apple.Foundation          0x951ff732 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 49
9   com.apple.CoreFoundation      0x95a305a4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
10  com.apple.CoreFoundation      0x9591204b _CFXNotificationPost + 3435
11  com.apple.Foundation          0x951ee21f -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
12  com.apple.AppKit              0x944f1575 -[NSApplication _postDidFinishNotification] + 367
13  com.apple.AppKit              0x944f1215 -[NSApplication _sendFinishLaunchingNotification] + 239
14  com.apple.AppKit              0x944edb44 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 840
15  com.apple.AppKit              0x944ed431 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 277
16  libobjc.A.dylib                0x9355e304 -[NSObject performSelector:withObject:withObject:] + 77
17  com.apple.Foundation          0x9520e47a __76-[NSAppleEventManager setEventHandler:andSelector:forEventClass:andEventID:]_block_invoke + 121
18  com.apple.Foundation          0x9520dfb1 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 430
19  com.apple.Foundation          0x9520ddbb _NSAppleEventManagerGenericHandler + 218
20  com.apple.AE                  0x98f54b15 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) + 387
21  com.apple.AE                  0x98f23ed6 dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 44
22  com.apple.AE                  0x98f23dce aeProcessAppleEvent + 318
23  com.apple.HIToolbox            0x9ba08571 AEProcessAppleEvent + 55
24  com.apple.AppKit              0x944e9148 _DPSNextEvent + 1089
25  com.apple.AppKit              0x944e8870 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
26  com.apple.AppKit              0x944db15c -[NSApplication run] + 727
27  com.xxxxxxxxxx.su          0x000631c8 CustomApplicationMain + 428
28  com.xxxxxxxxxx.su          0x00063643 main + 280
29  com.xxxxxxxxxx.su          0x000022ee _start + 228
30  com.xxxxxxxxxx.su          0x00002209 start + 41

Thread 1 Crashed:
0   libsystem_kernel.dylib        0x92cdc046 __workq_kernreturn + 10
1   libsystem_pthread.dylib        0x97e27dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib        0x97e2bcce start_wqthread + 30

Thread 2:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib        0x92cdc992 kevent64 + 10
1   libdispatch.dylib              0x9be49899 _dispatch_mgr_invoke + 238
2   libdispatch.dylib              0x9be49532 _dispatch_mgr_thread + 52

Thread 3:
0   libsystem_kernel.dylib        0x92cdc046 __workq_kernreturn + 10
1   libsystem_pthread.dylib        0x97e27dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib        0x97e2bcce start_wqthread + 30

Thread 4:
0   libsystem_kernel.dylib        0x92cdc046 __workq_kernreturn + 10
1   libsystem_pthread.dylib        0x97e27dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib        0x97e2bcce start_wqthread + 30

Thread 5:
0   libsystem_kernel.dylib        0x92cdc046 __workq_kernreturn + 10
1   libsystem_pthread.dylib        0x97e27dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib        0x97e2bcce start_wqthread + 30

Thread 6:
0   libsystem_kernel.dylib        0x92cdc046 __workq_kernreturn + 10
1   libsystem_pthread.dylib        0x97e27dcf _pthread_wqthread + 372
2   libsystem_pthread.dylib        0x97e2bcce start_wqthread + 30

Thread 7:
0   libsystem_kernel.dylib        0x92cd6f7a mach_msg_trap + 10
1   libsystem_kernel.dylib        0x92cd616c mach_msg + 68
2   com.apple.CoreFoundation      0x95978bf9 __CFRunLoopServiceMachPort + 169
3   com.apple.CoreFoundation      0x959781d1 __CFRunLoopRun + 1393
4   com.apple.CoreFoundation      0x959779ea CFRunLoopRunSpecific + 394
5   com.apple.CoreFoundation      0x9597784b CFRunLoopRunInMode + 123
6   com.apple.AppKit              0x94692b88 _NSEventThread + 283
7   libsystem_pthread.dylib        0x97e265fb _pthread_body + 144
8   libsystem_pthread.dylib        0x97e26485 _pthread_start + 130
9   libsystem_pthread.dylib        0x97e2bcf2 thread_start + 34

Thread 1 crashed with X86 Thread State (32-bit):
  eax: 0x00100170  ebx: 0x00001103  ecx: 0xb0080f9c  edx: 0x92cdc046
  edi: 0x97e27c69  esi: 0xb0081000  ebp: 0xb0080fc8  esp: 0xb0080f9c
   ss: 0x00000023  efl: 0x00000282  eip: 0x92cdc046   cs: 0x0000000b
   ds: 0x00000023   es: 0x00000023   fs: 0x00000023   gs: 0x0000000f
  cr2: 0x0146b000
 
Logical CPU:     0
Error Code:      0x00100170
Trap Number:     132


External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 5
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 1938
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=151.7M resident=71.3M(47%) swapped_out_or_unallocated=80.4M(53%)
Writable regions: Total=149.6M written=14.8M(10%) resident=21.7M(14%) swapped_out=0K(0%) unallocated=128.0M(86%)

REGION TYPE                      VIRTUAL
===========                      =======
CG backing stores                  5684K
CG image                             12K
CG raster data                       12K
CG shared images                    172K
CoreServices                         64K
IOKit                              4096K
Kernel Alloc Once                     4K
MALLOC                            114.1M
MALLOC (admin)                       48K
Memory Tag 242                       12K
Memory Tag 249                      156K
Stack                              67.1M
VM_ALLOCATE                        16.4M
__DATA                             16.7M
__IMAGE                             528K
__IMPORT                              8K
__LINKEDIT                         46.8M
__OBJC                             1848K
__PAGEZERO                            4K
__TEXT                            104.9M
__UNICODE                           544K
mapped file                       154.6M
shared memory                         4K
===========                      =======
TOTAL                             533.5M

Model: MacPro3,1, BootROM Niresh12495.com, 4 processors, Intel Core i7, 2.39 GHz, 4 GB, SMC 1.30f3
Graphics: ATI Mobility Radeon HD 7670, ATI Mobility Radeon HD 7670, PCIe, 2048 MB
Memory Module: BANK 2/DIMM1, 4 GB, DDR3, 1600 MHz, N/A, N/A
Bluetooth: Version 4.2.6f1 14216, 3 services, 22 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
PCI Card: ATI Mobility Radeon HD 7670, Display Controller, Slot-1
Serial ATA Device: TOSHIBA MQ01ABF050, 500,11 GB
Serial ATA Device: TSSTcorp CDDVDW SN-208DN
USB Device: Hub
USB Device: USB to ATA/ATAPI bridge
USB Device: USB2.0-CRW
USB Device: TOSHIBA Web Camera - HD
USB Device: Mass Storage Device
USB Device: USB Optical Mouse
USB Device: Bluetooth USB Host Controller
USB Device: Hub
Thunderbolt Bus:

Title: Re: Error with Mac APP
Post by: Kitty Hello on 2014-Aug-25
Crash is in ENDPOLY... Can you post a minimal example that crahes?

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-25
it is possible that the problem is here?

Code (glbasic) Select

STARTPOLY num
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\
POLYVECTOR x1,y1,0,0,color
POLYVECTOR x1,y1+y2,0,sy,color
POLYVECTOR x1+x2,y1+y2,sx,sy,color
POLYVECTOR x1+x2,y1,sx,0,color
ENDPOLY


How do I post a demo of the error?
My game has a lot of code and a lot of calls to STARTPOLY
I do not know what that genrated the error.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-25
Yes the problem it's:
Code (glbasic) Select

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\


but now i have the Backgroud scroll with 1 line Black Pikel.
How to fix????
Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Aug-25
hoe about move glTexParameteri before STARTPOLY?

Also its could been some sourt of unsupported feature on Mac in one of the parameter.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-25
Quote from: spacefractal on 2014-Aug-25
hoe about move glTexParameteri before STARTPOLY?

Also its could been some sourt of unsupported feature on Mac in one of the parameter.

If i move before startpoly, don't work .....
And now, how fis this?
I have black line in the middle of the 2 images of the background... it's horrible
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-25
Yes, you can't do anything within START/ENDPOLY blocks.

What you could try doing is splitting the routine into two, so that you can modify the texture parameters.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-26
Quote from: MrTAToad on 2014-Aug-25
Yes, you can't do anything within START/ENDPOLY blocks.

What you could try doing is splitting the routine into two, so that you can modify the texture parameters.

I don't know how ....
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-26
Please help, I have to fix this problem!
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-26
Could try :

Code (glbasic) Select

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\
STARTPOLY num,1
                POLYVECTOR x1,y1,0,0,color
                POLYVECTOR x1,y1+y2,0,sy,color
                POLYVECTOR x1+x2,y1+y2,sx,sy,color
                POLYVECTOR x1+x2,y1,sx,0,color
                ENDPOLY


Or perhaps change the 1 to 2
Title: Re: Error with Mac APP
Post by: Moru on 2014-Aug-26
It's much easier to help you if you can create a minimal testprogram that crashes. Include all needed data, zip it up and attach it to your post here.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-26
Quote from: MrTAToad on 2014-Aug-26
Could try :

Code (glbasic) Select

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\
STARTPOLY num,1
                POLYVECTOR x1,y1,0,0,color
                POLYVECTOR x1,y1+y2,0,sy,color
                POLYVECTOR x1+x2,y1+y2,sx,sy,color
                POLYVECTOR x1+x2,y1,sx,0,color
                ENDPOLY


Or perhaps change the 1 to 2

I try, but don't work, with flag 1 or 2  becomes worse ....


Quote from: Moru on 2014-Aug-26
It's much easier to help you if you can create a minimal testprogram that crashes. Include all needed data, zip it up and attach it to your post here.

I found the error, read the whole discussion ...   :'(

Other solution????  :nw:


Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-26
Ok I prepared a small example.

If you go to the end of the code, you see:

Code (glbasic) Select

IMPORT "C" void __stdcall glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S%                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T%                                  = 0x2803


FUNCTION z_drawstage: num%,x%,y%,flip=0,xzoom = 0, yzoom = 0, adv_x = 0, Scale# = 1, color=0xFFFFFF, lungh = -1
LOCAL sx,sy,x1,y1,x2,y2

GETSPRITESIZE num,sx,sy

IF lungh >= 0 THEN sx = lungh

IF xzoom <> 0 THEN xzoom = x_zoom + xzoom
IF yzoom <> 0 THEN yzoom = y_zoom + yzoom

IF xzoom <> 0 THEN x = x - adv_x


IF xzoom = 0 THEN xzoom = x_zoom
IF yzoom = 0 THEN yzoom = y_zoom



x1=(x_offset+(x*xzoom)) * Scale#
x2=(sx*xzoom) * Scale#
y1=(y_offset+(y*yzoom)) * Scale#
y2=(sy*yzoom) * Scale#


STARTPOLY num
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\
POLYVECTOR x1,y1,0,0,color
POLYVECTOR x1,y1+y2,0,sy,color
POLYVECTOR x1+x2,y1+y2,sx,sy,color
POLYVECTOR x1+x2,y1,sx,0,color
ENDPOLY
ENDFUNCTION



if you put in Rem, the two lines or put on STARTPOLY num), you see the error:
Code (glbasic) Select

//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\


The BG sprites are 301px W X 300 px H, i remove 1 PX to overlay the sprites:

Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-26
Could always subtract 0.5 from x1 and y1 - that works!
Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Aug-27
you could also convert it to integer to make sure its dosent get somewhere a float, which often seen the issue. This is was im do when im scaling my game to make sure you dont seen black lines.

can been done something like x=INTERGER(x)
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-27
Quote from: MrTAToad on 2014-Aug-26
Could always subtract 0.5 from x1 and y1 - that works!

I test with this value:
Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 299.5
IF i = 3 THEN x = 599.5


and with this:

Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 300.5
IF i = 3 THEN x = 600.5


But if I scroll the BG (Left and Right arrow Keys) I see the black line!

Quote from: spacefractal on 2014-Aug-27
you could also convert it to integer to make sure its dosent get somewhere a float, which often seen the issue. This is was im do when im scaling my game to make sure you dont seen black lines.

can been done something like x=INTERGER(x)

I do not understand how it should work, but i test with:

Code (glbasic) Select

IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600
x=INTEGER(x)
av_x =INTEGER(av_x)
z_drawstage( i,x + av_x,0)


But the line black remains.

Please test directly in my example, and post me the code!
I'm stuck on this problem for 3 days...  :rant:
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-27
Try this :

Code (glbasic) Select
        x1=(x_offset+(x*xzoom)) * Scale# - 0.5
        x2=(sx*xzoom) * Scale#
        y1=(y_offset+(y*yzoom)) * Scale# - 0.5
        y2=(sy*yzoom) * Scale#
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-27
Quote from: MrTAToad on 2014-Aug-27
Try this :

Code (glbasic) Select
        x1=(x_offset+(x*xzoom)) * Scale# - 0.5
        x2=(sx*xzoom) * Scale#
        y1=(y_offset+(y*yzoom)) * Scale# - 0.5
        y2=(sy*yzoom) * Scale#


If you test in my example, you'll see that in the beginning, it seems correct, but if you move the BG you can see the black line!

Please test with my example!  :nw:
Title: Re: Error with Mac APP
Post by: Qedo on 2014-Aug-27
Tell a banality. Have you tried Power of Two image?
try with 256x256 image.
I can not verify because I have not a MAC.
Ciao
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-27
Quote from: Qedo on 2014-Aug-27
Tell a banality. Have you tried Power of Two image?
try with 256x256 image.
I can not verify because I have not a MAC.
Ciao
It's possible to work but I have almost finished to make my game, and all my stages are not Px2 Sprites!
The only system to work without problem on a mac it's to inser this 2 lines of code directly in gl_b source code.

Please Kitty Hello (Gernot) insert in source code this 2 line:

Code (glbasic) Select

                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\


I wait you for release my game!  :good:



Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-27
It will be hard to position due to scaling unfortunately.  It looks like STARTPOLY texture mapping system with glTexParameteri.

A power of two texture would help though
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-27
Quote from: MrTAToad on 2014-Aug-27
It will be hard to position due to scaling unfortunately.  It looks like STARTPOLY texture mapping system with glTexParameteri.

A power of two texture would help though

It's impossible to change all sprites of my game ....
:rant: :rant: :rant: :rant: >:D >:D >:D >:D >:D :help: :help: :help:
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-27
Use :

Code (glbasic) Select
WHILE TRUE
SMOOTHSHADING FALSE
IF KEY(203) THEN av_x = av_x + 3
IF KEY(205) THEN av_x = av_x - 3

FOR i = 1 TO 3
IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600

z_drawstage( i,x + av_x,0)
NEXT

SHOWSCREEN
WEND


That works fine with scrolling
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-27
Quote from: MrTAToad on 2014-Aug-27
Use :

Code (glbasic) Select
WHILE TRUE
SMOOTHSHADING FALSE
IF KEY(203) THEN av_x = av_x + 3
IF KEY(205) THEN av_x = av_x - 3

FOR i = 1 TO 3
IF i = 1 THEN x = 0
IF i = 2 THEN x = 300
IF i = 3 THEN x = 600

z_drawstage( i,x + av_x,0)
NEXT

SHOWSCREEN
WEND


That works fine with scrolling


Work fine, the problem it's the gfx... are horrible ....  :'(

the pixels are shelled, ruined (I don't know how to explain)  ....
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-28
Its mainly due to the anti-aliased text.  Unfortunately anti-aliasing is unpredictable with scaling.

If you really need anti-aliasing, then you may need to take into account the slight gap or see if Gernot adds in some clamping stuff.



Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-28
Quote from: MrTAToad on 2014-Aug-28
Its mainly due to the anti-aliased text.  Unfortunately anti-aliasing is unpredictable with scaling.

If you really need anti-aliasing, then you may need to take into account the slight gap or see if Gernot adds in some clamping stuff.

I send a private message to Kitty Hello .... and now I wait and I pray ....  :nw:
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-28
Other problem in Mac
1) if ISMUSICPLAYING() = TRUE then STOPMUSIC  the music dosn't stop!
2) MUSICVOLUME  don't work!
3) PLAYSOUND(num%, pan#, volume#) with WAV don't work!

Shit Mac!  :whip:
Title: Re: Error with Mac APP
Post by: Schranz0r on 2014-Aug-28
If i understand right you have a problem with youre textures... it's called "Texturebleeding" :blink:

GLB use on glTexParameteri for Texture2D GL_LINEAR, what you need is to change to GL_NEAREST !
Should solve youre problem...
Title: Re: Error with Mac APP
Post by: Moru on 2014-Aug-28
If I remember right, can't find the source right now:

Many old grafics-cards do not support images in arbitrary sizes, they only support SQUARE sizes at power of two. This means 64x64 is ok, 256x256 is also ok. However, 300x301 is not ok. To fix this, GLBasic will resize the working surface to 512x512 and fill the rest of the image with 0. When you use anti-alias to make your edges smooth, the grafics card will pick the average of the colors between your image and this black border.

There is methods for getting around this, one is to disable anti-alias. Not so sure of the others since I haven't been doing this for years but at one time I got around it by setting the texture pixel size 0.5 or 0.75 pixels smaller than the actual image with polyvectors. Not sure if this hack works in the newer versions of GLBasic.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-28
Quote from: Moru on 2014-Aug-28
If I remember right, can't find the source right now:

Many old grafics-cards do not support images in arbitrary sizes, they only support SQUARE sizes at power of two. This means 64x64 is ok, 256x256 is also ok. However, 300x301 is not ok. To fix this, GLBasic will resize the working surface to 512x512 and fill the rest of the image with 0. When you use anti-alias to make your edges smooth, the grafics card will pick the average of the colors between your image and this black border.

There is methods for getting around this, one is to disable anti-alias. Not so sure of the others since I haven't been doing this for years but at one time I got around it by setting the texture pixel size 0.5 or 0.75 pixels smaller than the actual image with polyvectors. Not sure if this hack works in the newer versions of GLBasic.

For old card you have right, but now the low card on PC it's HD4000, I don't think today it's a problem to clamp a texture on Polys!
How to setting the pixel 0.5 or 0.75?

Quote from: Schranz0r on 2014-Aug-28
If i understand right you have a problem with youre textures... it's called "Texturebleeding" :blink:

GLB use on glTexParameteri for Texture2D GL_LINEAR, what you need is to change to GL_NEAREST !
Should solve youre problem...

I think the command to change is GL_CLAMP_TO_EDGE, and I hope to possible to do (with a flag for on/off)!
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-28
Just have to wait and see now whether it can be done
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-28
Quote from: MrTAToad on 2014-Aug-28
Just have to wait and see now whether it can be done

Sure you are right! I'll wait!  :nw:

But for problem with command audio, someone else had my problem?
Title: Re: Error with Mac APP
Post by: Schranz0r on 2014-Aug-28
GL_LINEAR stratch pixels on resizing, thats "texturebleeding".
GL_NEAREST resize pixel by pixel, no "bleeding"

Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-28
Quote from: Schranz0r on 2014-Aug-28
GL_LINEAR stratch pixels on resizing, thats "texturebleeding".
GL_NEAREST resize pixel by pixel, no "bleeding"
ah ok ok sorry!  :good:
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-29
Ok Kitty_Hello he replied me:

Code (glbasic) Select
I use glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

But if I change the code:

Code (glbasic) Select

IMPORT "C" void __stdcall glTexParameterf(unsigned int flag0, unsigned int flag1, unsigned int flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S%                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T%                                  = 0x2803

etc etc

STARTPOLY num
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

etc etc


in windows does not seem to work (on Mac I have not tried it yet)...
I'm doing something wrong?
Title: Re: Error with Mac APP
Post by: Kitty Hello on 2014-Aug-29
Chech the args. One is a float!

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-29
Code (glbasic) Select

IMPORT "C" void __stdcall glTexParameterf(unsigned int flag0, unsigned int flag1, float flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S#                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T#                                  = 0x2803


Work fine on pc, now i test on Mac!
Wait for my reply :D
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-29
Will do ?  Are you using it in STARTPOLY though - which is the cause of the original problem ?
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-29
Quote from: MrTAToad on 2014-Aug-29
Will do ?  Are you using it in STARTPOLY though - which is the cause of the original problem ?

No, don't worK on a Mac .... -_-

Code (glbasic) Select

STARTPOLY num
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);



I see now this:
Code (glbasic) Select
*NEW* Current Version:  12.308

I need to update GL_B for work the code?

------------------------------
Don't work! .... Don't work! .... Don't work! ....   :whip:
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-29
I test the new ver. 12.308 on Mac and the Audio errors are the same:
1) if ISMUSICPLAYING() = TRUE then STOPMUSIC  the music dosn't stop!
2) MUSICVOLUME  don't work!
3) PLAYSOUND(num%, pan#, volume#) with WAV don't work!

and glTexParameterf don't work!

Angry ....  :rant:
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Aug-29
Another question, how to set Landscape on iOS (i use iPod 4th gen)
I test with:
- SETSCREEN 960,640,TRUE (and False
- SETSCREEN 9999,9998,TRUE (and FALSE)
and i test with resolution from Option -> Resolution  (On Gl_B IDE Menu)

But the game run i portrait ... WHY?

Other info:
i use xcode 5.1 and ipod 4th gen with ios 6.0.1
Title: Re: Error with Mac APP
Post by: MrTAToad on 2014-Aug-29
Cant help with that unfortunately.  I think there were only a couple of changes made - and none were to do with Mac's...
Title: Re: Error with Mac APP
Post by: Kitty Hello on 2014-Aug-30
On iOS use SETORIENTATION for landscape.

Gesendet von meinem GT-N7100 mit Tapatalk

Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Sep-02
look like its a real bug with sdl.

im do understand now why you want true with SMOOTHSHADING TRUE extractly this one (even its some sort of cheating). Howover you might require to avoid tiles here or do some sort of workaround on the edges by redraw edges with SMOOTHSHADING FALSE to hide the borderline.

Im have only tested on Windows here to checkout the isssue, but can seen why its might not work on MacOSx. Im can only thinks this is pretty much a real bug.

Im have a similar issue, where vSYNC does nothing at all. Im want this one to on.

So

Code (glbasic) Select

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);// Changed \\
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);// Changed \\


inside a POLYGON should have worked really, but fails on the ENDPOLY on that system for some reason (is the above supported on MAC?). SO im thinks this should should been moved to the bug thread, property with a renamed topic.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Sep-02
Ok, I opened a ticket in Bug section but since I can not waste more time I'll try to redo the Background with texture PX2.

I honestly I am not happy!
Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Sep-02
workaround is a part of fun when something goes wrong. Im even used a lots of time on a background in Spot Race, which later did got scrapped. Ohh dear.

if its only background you have issue it, you can apply a 2x or 4x texture on that problem background, and then implement a 0.5 zoom when its uses 2x texture or 0.25 zoom if its 4x by checking which size of background its have loaded (by GETSPRITESIZE). Rest of cordinates should not require change at all. Its depend how well the framework have been done. Rest of the game can still uses a internal resolution. Im do uses a lots of functions to do most automatic of that kind of work.

My games all used often 2 or 3 sizes of textures and newer try to upscaling them to avoid the ugly scaling. Spot Race is also a game, which slight kind border dont effect the game at all.

you can also tryout a virtual screen system with all smooth false, but let the final picture uses true. Im do no idea that works for your game. But howover there is issue with virtual screen on Mac.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Sep-02
I do not know what kind of game you did, but my game have many layers (2 parallax back and 1 front) with a lot of effects (lights, torches, signs switched on and off) and all sprites are not Px2.
If I have to change all levels, to get them with Px2 sprites and in various size,  they require a lot of work for me!
I do not want to make comparisons or criticisms, but I test my sprites in various middleware (Unity, GM and MMF) and they work fine without Px2 Sprites, I think it's a limit of GL_B.
Anyway I don't wait for fix (if ever will be fixed), i have to publish my game (I just hope the store accept my game without other problem)!

-------------------------------------
Another question, with Android Extras we have Admob, but iOS supported some system ADV?
Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Sep-03
after that very much debate Gernot have time to look what it happens or not (sorry for all those offtypic debate, if you ask me that debate can been removed by a admin, include mine).

But its seen its a very easy fix for that one.

If you change

IMPORT "C" void __stdcall glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);

to

IMPORT "C" void glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);

then its now works.

So its a pretty simple bug for Gernot to fix that one. He just need to remove the __stdcall (which seen to fails on MacOSx) calls when its got precompiled on MacOSx.. Or its not required at all, since we also can uses ?IFDEF feature. This is something that need to been documented in the HELP file.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Sep-03
oh big man ... I try it now and tell you if it works!  :nw:
Title: Re: Error with Mac APP
Post by: Kitty Hello on 2014-Sep-04
oh. Stdcall on Mac should be defined to nothing. I have to see what it resolves to...
Title: Re: Error with Mac APP
Post by: spacefractal on 2014-Sep-04
its might required in some chases. but not in that IMPORT. ENDPOLY might have crashed due that __stdout call. Its strange really here. But at least its worked on my Mac when tested the example.
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Sep-04
Great News ... The code work fine!  :nw:

For Android and Win
Code (glbasic) Select

IMPORT "C" void __stdcall glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S%                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T%                                  = 0x2803


For Mac
Code (glbasic) Select

IMPORT "C" void glTexParameteri(unsigned int flag0, unsigned int flag1, unsigned int flag2);
GLOBAL GL_CLAMP_TO_EDGE%                                   = 0x812F
GLOBAL GL_TEXTURE_2D%                                      = 0x0DE1
GLOBAL GL_TEXTURE_WRAP_S%                                  = 0x2802
GLOBAL GL_TEXTURE_WRAP_T%                                  = 0x2803


and in Polys:
Code (glbasic) Select

STARTPOLY num
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
POLYVECTOR x1,y1,0,0,color
POLYVECTOR x1,y1+y2,0,sy,color
POLYVECTOR x1+x2,y1+y2,sx,sy,color
POLYVECTOR x1+x2,y1,sx,0,color
ENDPOLY


I have to try it on iOS!
Thanks to Gernot and Spacefractal for BIG HELP! :good: :nw:
Title: Re: Error with Mac APP
Post by: kanonet on 2014-Sep-04
On Android and Win you use float and on Mac integer, any reason for this?
Title: Re: Error with Mac APP
Post by: Kyo on 2014-Sep-04
Sorry, you are right kanonet, I edited the post ...  :whistle: