Thank you so much for your answer, that's awesome!
I've begun to suspect that anything requiring pure OpenGL is going to be
a pain since I'll have to get someone to check everything I do, so I've
just begun to focus my efforts on running the Pyglet event loop from
within WX.
I have the code for the tiles - which even works (surprisingly), and
it'll give me the added benefits of game controler support et al.
Have you managed to integrate the two libraries? I could just use a
thread... but I already have twisted running inside of a further thread,
and having three running consecutively seems extraneous.
Thank you again for all the info, it's been really helpful!
Take care,
Chris
On 07/12/2016 23:17, [email protected] wrote:
Getting some API's to work together can sometimes be a tricky affair.
I've only just started digging into wxpython recently, and while it
has a glCanvas function it seems to depend on PyOpenGL to work. I have
managed to dig up a script [here
<https://gist.github.com/Ryex/f8c9df05a65d311aa6ec>] that seems to
blend a pyglet GL context with wxpython though, so that may be the
direction you want to go in.
As for your other questions:
- Is there some prefered way to draw maps in Open GL?
That largely depends on the requirements such as how the map is
structured, how large it is, how many images are being drawn, etc. If
its a single image than using a simple blit call may suffice, though
if your rendering lots of images then using batch rendering may be a
more efficient approach.
- Do I use pure colours for my squares? Or does GL have textures I can
use for say sand and metal and water?
GL does not have built in textures, but it absolutely can use them if
you supply them. You can also use pure colors, but thats up to you.
- If I then overlay icons (player and object avatars) on the squares,
will it look OK?
That depends, using overlaid icons and sprites usually involves color
keying, which involves removing certain colors and making them
transparent as with an Alpha Channel. So assuming we have a square
tile and a not square avatar on its own tile, without color keying the
avatar would be surrounded by its own white square outline, but with
color keying you'd only see the avatar itself overlaid on the tile
instead. This involves a little prep work with the sprites image
itself by either selecting a color and removing it in code, or
applying an alpha channel and transparency to it and filtering them
out, which is usually fairly straight forward.
- How many squares can I realistically fit onto a screen? I plan to
implement a zoom feature, but by default I was thinking 4 squares on
either side of the player, so they'll be at the centre of a 9x9 grid
(totalling 81 squares).
This depends on what resolution you want the programs window to run
at, the resolution of the host system, and the size of the tiles you
want to use. A monitor is made of individual pixel dots, each their
own color, the "resolution" is a description of how many pixels there
are in a row, and how many rows there are. So a 640x480 resolution
would be 640 pixels per horrizontal row, with 480 rows, for a total of
307200 pixels. Tiles can range in size wildly, from 8x8 or even
128x128. So knowing the resolution and the size of the tiles can tell
you how many tiles you can fit on the screen, if working with a
640x480 resolution and 32x32 tiles you can fit 300 tiles on the
screen, 20 per horrizontal row with 15 rows. Some of the more common
resolutions on PC are around 320x240, 640x480, or 800x640 and higher.
General tile sizes are usually around 8x8, 16x16, 32x32 or 64x64 to
varying degrees.
I can also provide some examples on rendering or blending if you'd like.
--
You received this message because you are subscribed to the Google
Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.