You mean inside of the q3 code, or inside of sdl2 ? I only tried so far doing this inside of createcontext() in the sdl2:
I mean taking a simpler example than Q3. I believe OGLES2 SDK contains some? Or SDL2 has also some OGLES2 test case.
Quote:
Do you mean in q3 code, or inside of SDL2 , right after aglSwapBuffers() ?
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.
I mean taking a simpler example than Q3. I believe OGLES2 SDK contains some? Or SDL2 has also some OGLES2 test case.
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..
@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 :(
And put at top of function, and after SDL_GL_SwapWindow glCheckError():
void GLimp_EndFrame( void )
{
glCheckError();
// don't flip if drawing to front buffer
if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
{
SDL_GL_SwapWindow( SDL_window );
}
glCheckError();
..blablabl
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.
@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 ?
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.
@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.
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 I'm here forever X1000 + AmigaOS 4.1 FE "Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
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.
@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 ?
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 ..
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.
Competition Pro has mapping for only rightx/righty:
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:
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
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:
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.
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:
It's best if application could provide some configurability regarding buttons and axes.
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.
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 ?
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:
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 :)
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:
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.
Next SDL2 release shall contain the test programs.
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.
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.
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.
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:
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.
quote ptitSeb's answer:
Quote:
Now, for Gamecontroller, the idea behind this API is to propose a Plug'n Play way to use a joystick: you plug it in, and because the Layout and mapping is standardized (look at XB360, XBOne, PS3 or PS4 controlleurs: they all offerts similar basic functions on a similar layout: left and right stick, left dpad, 4 fae buttons, 4 triggers, 1 back and 1 start buttons basically). So, for Gamecontroller, the point is to not have any config screen, it just work, with a fixed layout.
For joystick, a config screen would be needed. But as I don't like programming GUI, I don't think I'll do that (plus, it's a long and tedious work to program that GUI for joystick option for just 20 sec of use).
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.
@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 ?
But why choicen for amigaos4 are rightx and righty, and not leftx and rightx ?
It was added in March 2016 so can't really remember.
Quote:
ptitSeb add amigaos4 ifdefs to the code, so to use rightx/righty, but the choice to use Right axis
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:
and Left is a bit strange, he would assume default to be left.
Why left is default?
Quote:
But that quite suck to have such ifdefs imho (i mean, it always will need amigaos4 adaptation then).
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.