[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Fri, 22 Feb 2013 18:37:22 -0700, Trent Gamblin <nooskewl@xxxxxxxxxx> wrote:
> There are some integration hacks like in the primitives addon so maybe it should.
Ok.
I find the al_set_shader/al_set_shader_*/al_use_shader pattern to be
quite confusing, in terms of what calls are required and in what order.
How about something like:
// al_prepare_set_shader MUST be called prior to setting one or
// more shader variables. If you don't need to set any shader
// variables it may be omitted. Not sure about the name.
al_prepare_set_shader(shader);
al_set_shader_*(shader, ...);
al_set_shader_*(shader, ...);
// This should work without calling al_prepare_set_shader.
al_use_shader(shader);
al_draw_bitmap(...);
al_use_shader(NULL);
It's only some minor tweaking so I don't think it will lose any
functionality.
Other proposed changes:
- Drop the display argument to al_set_opengl_program_object, as it
requires the display's render context to be current anyway.
Maybe do the same for al_set_direct3d_effect for symmetry.
- Consider renaming al_link_shader() to something more neutral.
- Drop the Cg backend. I never got it to work and al_set_shader was
never implemented for it and nobody complained. This is mainly to
give ourselves less to polish.
Peter