Got a question # version of the SDL, I will apply it to my projects by
guarantee. Today I have no problem doing it so I’m on the computer, but if
others can help give me trouble. Thanks for the tip.
In the matter of drawing in iOS, it may not be problem in openGL ES 2.0,
perhaps a failure to draw even SDL_GL_SwapWindow () for iOS or’m forgetting
something. I think there is no point changing the policy drawing on the
desktop because this drawing the usual triangle.
Today I update the repository thinking that could have been corrected,
however q seems worse now or draws the background color, everything is
black.
I never used glViewport when I’m using shaders because the values of the
screen size was standardized -1, 1, -1, 1. As for policy design, so would
change the shape of the design.
2013/5/16 Scott Percival > Yes, the tip about adding “#version 120\n” was unrelated to your problem
per se., just an observation I had in general about compatibility. Right
now your OS X version runs under Intel’s OpenGL 2.1 driver, which so
happens to use GLSL 1.20. Some implementations (i.e. AMD) will assume a
later version of GLSL and so complain about the 1.20 syntax, so it helps to
specify the GLSL version at the start.
Annoyingly I don’t have access to my GLES 2.0 dev machine for a while, so
I can’t test your code. At a guess, maybe call glViewport(0, 0, 512, 512)
to set the default transformation, and change GL_TRIANGLES to
GL_TRIANGLE_STRIP?
On 16 May 2013 08:43, Silvio Fragnani <@Silvio_Fragnani>wrote:
On the question SDL_GL_CONTEXT_MAJOR / MINOR_VERSION, even though 3.2 by
setting the example, he assumes the highest value below the value reported.
Using glGetString (GL_VERSION) and glGetString
(GL_SHADING_LANGUAGE_VERSION), respectively:
- IOS: APPLE OpenGL ES 2.0 and OpenGL ES GLSL ES 1.0.
- On MacOSX: 2.1-INTEL 8:10:44 and 1.20.
In this example the problem is that it is not drawing the triangle in
iOS, only on MacOSX (desktop).
I’ve made an example in OpenGL ES 1.1 for iOS, however would like to use
shaders (ES 2.0).
2013/5/15 Scott Percival
Make sure you set SDL_GL_CONTEXT_MAJOR/MINOR_VERSION appropriately. For
OpenGL ES platforms, you’d want MAJOR to be set to 2 and MINOR to be 0.
Also be careful about desktop compatibility when writing GLSL targeted
for GL ES; plenty of cases where NVIDIA will let you get away with murder,
but ATI will have a good cry instead. The easiest workaround I found was to
prepend “#version 120\n” to the desktop shaders.
2013/5/13 Silvio Fragnani <@Silvio_Fragnani>
ops, code attached.
Em 12 de maio de 2013 19:06, Silvio Fragnani < @Silvio_Fragnani> escreveu:
Hello.
I am trying to create a simple code example using openGL with shader.
But the code only works on desktop (macosx), I tried to run on iOS,
but only paints the background and not the design (colored triangle).
Code attached.
Screen images in
https://www.cubby.com/pl/shared/_d4a1c77005f54e41b9d11b38a3beab8c
What is wrong?
Thank you.
–
s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.
“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque
sua consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)
“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O
mundo s? ter? uma gera??o de idiotas”
(Albert Einstein)
“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a
mesma coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)
“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)
–
s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.
“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque
sua consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)
“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O
mundo s? ter? uma gera??o de idiotas”
(Albert Einstein)
“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a
mesma coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)
“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.
“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque
sua consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)
“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)
“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)
“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.
“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque sua
consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)
“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)
“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)
“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)