|
Re: SDL2 |
Posted on: 2018/12/16 10:30
#581 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
Quote:
I mean taking a simpler example than Q3. I believe OGLES2 SDK contains some? Or SDL2 has also some OGLES2 test case. Quote:
It doesn't really matter, but Q3 is the logical place. Application knows when the frame ends and should do error checking. Locate call to SDL_GL_SwapWindow. |
|
|
Re: SDL2 |
Posted on: 2018/12/16 20:53
#582 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Quote:
Simple ogles2 test cases works fine with SDL2 in oversized windowses, as well simple gl4es/sdl2 test cases too, as well as other game compiled via gl4es/sdl2 also works fine in oversized window. Its exactly q3 which produce black window when it oversized, which by logic we can then blame, if not only fact that minigl version works fine from the same q3/sdl2 code.. |
|
|
Re: SDL2 |
Posted on: 2018/12/18 8:57
#583 |
---|---|---|
Not too shy to talk
![]() ![]() Joined:
2011/6/3 13:49 Posts: 267
|
@kas1e
>why it happens only with Q3[...] It should be in any game From my own experience in debugging : never assume "It should be" but only check what really is/happen in the prog. ![]() So in this case: have a look to what bitmap is currently used ... just to be sure. Alain |
|
|
Re: SDL2 |
Posted on: 2018/12/19 17:26
#584 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
I also tried to use "bitmap" way, as you have to do with SDL_os4opengles.c, with those MANAGE_BITMAP ifdefs, and it while it works, it still give the same black window in q3 when oversized window used. Damn :( |
|
|
Re: SDL2 |
Posted on: 2018/12/19 17:48
#585 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
Did you try glGetError()? |
|
|
Re: SDL2 |
Posted on: 2018/12/19 18:22
#586 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Quote:
Yeah, in q3's code/sdl/sdl_glimp.c , we have there GLimp_EndFrame() function which has at top SDL_GL_SwapWindow(). So i made that:
const char* glGetErrorString(GLenum error)
And put at top of function, and after SDL_GL_SwapWindow glCheckError():
void GLimp_EndFrame( void )
And it prinfs nothing, like no errors.. Tried both modes and when window fits in wb size, and when didn't, no errors in both cases , just in oversized one black window. |
|
|
Re: SDL2 |
Posted on: 2019/1/1 11:06
#587 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Is SDL2's Gamecontroller interface fully supported ? I see you code lots of amigainput's code in, so probably it supported, but is all implemented as it should be ? And how it detect the stuff, i mean, different joysticks have needs to be configured probabaly via amigainput before they can be used via SDL2 gamecontroller interface ? |
|
|
Re: SDL2 |
Posted on: 2019/1/1 14:12
#588 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
It supports only one joystick currently, Competition Pro. Some pads like XBOX-360 and Steam controller were not recognized by AmigaInput so they cannot be used right now. Reference: https://github.com/AmigaPorts/SDL/blob ... L_gamecontrollerdb.h#L590 This database can be appended by using test/controllermap which generates entries. I have made a test archive available ( http://capehill.kapsi.fi/sdl2/SDL_joystick_test.lha ) that can be used to: 1) test (AI-compatible) joystick: testjoystick 2) test gamecontroller (Competition Pro only!): testgamecontroller 3) configure mappings: controllermap. If you have some joystick you can send the mappings to me or make a PR on Github. I just tested Competition Pro using test/testgamecontroller application. Directions worked, same with four buttons: A, B, X and Y. |
|
|
Re: SDL2 |
Posted on: 2019/1/1 18:51
#589 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Thanks for detailed answer, all clear now. We can say that just if one want joystick on SDL2 joystick interface: then Competition PRO only at moment. |
|
|
Re: SDL2 |
Posted on: 2019/1/1 23:25
#590 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/2/23 13:49 From Finland, the land of Santa, sauna, sisu and salmiakki
Posts: 1107
|
@Capehill
The tests from SDL_joystick_test claims that I don't have any joysticks connected which is wrong. I have Competition Pro USB connected. (See Fricking shark subject.) amigainput.library v53.4. |
|
_________________
Rock lobster bit me, so excuse me. X1000 + AmigaOS 4.1 FE "Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray |
||
|
Re: SDL2 |
Posted on: 2019/1/2 17:42
#591 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
SDL joystick API supports joysticks that work with AmigaInput. SDL game controller API supports those joysticks that have mapping in the game controller database. There is only one added so far. |
|
|
Re: SDL2 |
Posted on: 2019/1/2 17:45
#592 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@TSK
That is strange. I re-tested "testjoystick" with SDL 2.0.8 and it found my Competition Pro. Directions worked, pressing some button caused missing symbol: the issue is test archive is built from 2.0.9+ sources so I guess the test code is not backwards compatible. |
|
|
Re: SDL2 |
Posted on: 2019/1/3 8:53
#593 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Did i understand right, that there is 2 ways to handle joysticks in SDL2 apps ? One are SDL joystick API and another one is SDL game controller API ? If so, what way is prefereble and better for amigaos4, and, is they both mixed and can work together, or, if programmed for one way, another one didn't works ? Why i ask is that if you say we have onluy support for Competition Pro via GameController's API, then, other joysticks should't works at all, or, they still will, just with "wrong" mapping ? Why i ask, is that if you will check that topic: http://www.amigans.net/modules/xforum ... hp?topic_id=7931&forum=11 You can see, that when we have in game originall "Joystick" interface code, then for TSK's Cometition Pro joystick only left/right/up/down works, but buttons didn't. So, we made code to be not "Joystick" api, but GameController one, and then, for the same TSK's joystick , keys start to work for jump/fire, but left/right/up/down stop working. So, we check on linux that game with GameController's API, and with an XBox360 everything works fine. What mean, that probably our GameController's API realisation need some changes/fixes maybe ? Or remaping or whatever .. |
|
|
Re: SDL2 |
Posted on: 2019/1/3 18:36
#594 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
I checked some code, Hydra makes an assumption that there are leftx/lefty axes defined: https://github.com/ptitSeb/hydracastle ... ter/src/sdl2/input.c#L201 Competition Pro has mapping for only rightx/righty: https://github.com/AmigaPorts/SDL/blob ... L_gamecontrollerdb.h#L590 Regarding joystick API, I don't know right now what are the button numbers for Competition Pro. Probably from 0 to upwards, I have used "0" in Super Methane Bros and some other apps. Then again, if we check Hydra code, buttons 0-3 set directions: https://github.com/ptitSeb/hydracastle ... ter/src/sdl2/input.c#L156 What exactly should happen when joystick fire buttons (Comp Pro has 4) are active? SDL joystick API is better for now because the problem is, who will provide mappings for those AI-supported joysticks? They would need to be contributed to SDL project by various persons. I have about 2 joysticks that AI recognizes so that doesn't get us very far. It's best if application could provide some configurability regarding buttons and axes. |
|
|
Re: SDL2 |
Posted on: 2019/1/3 20:20
#595 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Quote:
But why ? I mean why for Competition Pro we have mapping only for rightx/righty, and not for leftx/lefty ? I mean is it something we can help with so to have full mapping ? Quote:
We need to ask TSK in "fricking shark" thread, so he can test it and give us right "mapping" for.. Or i can just buy Competition Pro myself, that will be faster and easy for tests in end :) Quote:
I can buy for example 3-4 popular joysticks which works on amigaos4 , +your 2 , and so, we will have 6 joysticks, to which we can add 100% support and be done with it. Then, for any other new joystik we can say to users : want to support your one ? Then follow that guide, and send us the mapping. Quote:
As i understand ptitSeb, the SDL2's Game Controller API is easy, and its easy to add to any game/app which didn't support it by default. So he done some "general" code one time, and can reuse it everywhere later. |
|
|
Re: SDL2 |
Posted on: 2019/1/4 7:20
#596 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
Quote:
Comp Pro has only 2 axes. Who can say which of the 6 SDL-supported axes should be chosen? Cannot pick more than 2 (tried). But since I think axis behaviour is not analog, maybe it would best to map Comp Pro axes as directional buttons. Quote:
Tested myself, Comp Pro buttons are 0-3 which is pretty logical. I don't know why SDL or AI reports 16 available buttons. Thing has only 4 buttons and I don't know how to get other buttons visible. Autofire selection didn't have impact. Quote:
Next SDL2 release shall contain the test programs. Quote:
Joystick API is not difficult either. In my opinion Hydra makes some wrong assumptions on available axes. I think (didn't test yet) SDL offers a way to query axis and in case of failure, it should return NULL. My own joystick code is not better, I have hard-coded axes 0 and 1, worked for me. Customer is the king, if possible, provide configuration options. |
|
|
Re: SDL2 |
Posted on: 2019/1/4 15:51
#597 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Quote:
But why choicen for amigaos4 are rightx and righty, and not leftx and rightx ? ptitSeb add amigaos4 ifdefs to the code, so to use rightx/righty, but the choice to use Right axis and Left is a bit strange, he would assume default to be left. That how current code looks like: https://github.com/ptitSeb/hydracastle ... b/master/src/sdl2/input.c You can see there: Quote:
But that quite suck to have such ifdefs imho (i mean, it always will need amigaos4 adaptation then). As for mapping before, it was used for Joystick interface buttons, not for Gamecontroller one. Anyway, it was bad and he add some default value, not that xbox360 mapping (that will be used in Gamecontroller mode anyway). Quote:
quote ptitSeb's answer: Quote:
I can add, that it is good to have code which you just copy+paste from one game to another, and it "just works", without needs to write gui options again and again for every new game, which in end will be so boring, that no joystick support will be in favor of time. |
|
|
Re: SDL2 |
Posted on: 2019/1/4 16:38
#598 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6707
|
@Capehill
Btw, forgot to ask in previous comment : i notice that when i start any SDL app which has sound/music, i offten heard some noise-pitch sound (a very small one, just like blep). Like initialization done, but i can heard it. Is it something in SDL, or , it just my AHI settings need to be ajusted somehow to avoid it ? |
|
|
Re: SDL2 |
Posted on: 2019/1/4 16:47
#599 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
Quote:
It was added in March 2016 so can't really remember. Quote:
Why he makes assumption that all our joysticks will have right axis if one has? By the way, you didn't comment my directional button proposal: I think it would be better. Competition Pro has really a "middle" axis. Quote:
Why left is default? Quote:
And what if controller has no axes? Axis code wouldn't work anyway, naturally. I'm not asking anyone to add GUI code. Most sane games have some configuration file, adding few lines there is not bad? At least it's faster to modify and test than C code. |
|
|
Re: SDL2 |
Posted on: 2019/1/4 16:49
#600 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1203
|
@kas1e
SDL2 doesn't clear audio buffer anymore, it must be done by the application now. https://wiki.libsdl.org/MigrationGuide#Audio |
|