Ok - took the DLL from JEDI-SDL ver 1 and it works properly now.
Thansk a lot MSX. Now I just have to try understand what was done.
I'll also first add a FPS count so that I can see the difference.
Ok - took the DLL from JEDI-SDL ver 1 and it works properly now.
Thansk a lot MSX. Now I just have to try understand what was done.
I'll also first add a FPS count so that I can see the difference.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
I added an FPS counter and got 186 when I ran the program A bit better than the 30 I was getting from my code.
Now I need to convert my S2DL units to use OpenGL.
How do I draw a small portion of an image tot he screen? I have png files that contain full sets of Sprites.
How do I define a transparent color per image?
How do I create a temporary surface on which to do a drawing? I want to create the current background on a surface and blit this to the screen and only update it when the background needs to change.
I'm sure there are going to be a pile more questions before this is done
My goal is not to change my interfaces into my S2DL units - this will allow me to just recompile game like Run-A-War and make them use OpenGL.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
Ok - got drawing a portion of the image to the screen.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
very wellOriginally Posted by cairnswm
[quote]
>How do I draw a small portion of an image tot he screen? I have png files that contain full sets of Sprites.
Just act on the glTextCoord on the DrawRectangle.
>How do I define a transparent color per image?
More than a transparent color you should use the alpha channel. If you look at the pointer.png image, you'll see that it have an alpha channel that makes the background trasparent (0).
BTW this let you have continuos alpha values, not just 1 or 0. You can have 50%, 30% etc on different portion of the same image..
>How do I create a temporary surface on which to do a drawing? I want to >create the current background on a surface and blit this to the screen >and only update it when the background needs to change.
Umm you should generate a texture at runtime. This is not very easy as all textures must be squared. So you should map the screen on a large texture (1024x1024). Once you create the texture, you should use some Render-to-texture tecnique, and then use the generated one for the background.
>My goal is not to change my interfaces into my S2DL units - this will allow me to just recompile game like Run-A-War and make them use OpenGL.
Well, probably you'll have to change something.. But if it's done well there will be only minor changes.
Bye!
If you save your data in a proprietary format, the owner of the format owns your data.
<br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>
Thanks MSX
Just got the Transparency work well - using the Alpha Channel (Thank Goodness for TheGimp).
So what is the render-to-texture technique?
I dont mind having to create a 1024/1024 texture if it will let me get a faster blitting working.
Can I use SDL_ttf and SFont with the OpenGL stuff or is there another Font component I can use?
I almost have my template working again. Except for background and Text I have been able to encapsulte everyting in my S2DL units and will not have to change any code in the main programs.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
The gimp is simply greatOriginally Posted by cairnswm
The best graphic program ever!
Well there are lots of different tecniques to do "render to texture" (that is, you render on a texture instead that on the screen, and then use that texture for the rendering)So what is the render-to-texture technique?
Here's a ]http://developer.nvidia.com/object/gdc_oglrtt.html[/url]
Anyway entering "opengl render to texture" on google gives you lots of good answares.
I've never implemented this becouse i never needed it. Don't know how much impact it can have..
Savage and me did some experimenting on running SFont.. you can probably find the post by him.Can I use SDL_ttf and SFont with the OpenGL stuff or is there another Font component I can use?
The problem is again with squared textures, since SFont expect straight font bitmaps.
In the program savage generated a texture for each word the program have to display. This is good if you have fixed text, but for dynamic text it's not good.
I thought about reading the straight bitmap and then for each character generate a small (32x32 or so) texture. This solution should work with bitmap variable size fonts (that was what i was searching when we experimented).
Alternatively, if you have fixed size font, you can create your own font texture and some functions that find the characters and render them. With fixed size fonts this is quite easy (you can find this in any of my programs)
Great, that's already more than i thoughtI almost have my template working again. Except for background and Text I have been able to encapsulte everyting in my S2DL units and will not have to change any code in the main programs.
If you save your data in a proprietary format, the owner of the format owns your data.
<br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>
Under the SDL_ttf directory, there should be an OpenGL demo of one way to render true type text using OpenGL.Originally Posted by cairnswm
Version 0-03 - Converted to OpenGL and Added a Cursor
Converted all graphics routines to OpenGL - this was a bit of a nightmare but in the end I got everything converted. Images were modified (thus included again).
The minimap had to be a factor of 2 so the map size has been downgraded from 100x100 to 64x64 but its still quite big enough.
Added a Nice sword as a mouse cursor.
Download the game so far from http://www.cairnsgames.co.za/downloa...es/rts0-03.zip
Download the source from http://www.cairnsgames.co.za/downloa...source0-03.zip
The source will need the EXE images to be able to run.
There are in fact very very minor changes in the way the program was written from 0-02 to 0-03 and the OpenGL calls. In fact only the code for the mini map and the removal of a predrawn background (I draw each tile now) were required - all other changes were done in my Images unit (S2DLImage for those looking at the code).
My thanks to Savage and MSX for thier help over the last few days.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
Well done!
I tryed to compile it under linux and it went with little changes.. You could consider to correct some things to make it linux compatible.. I'll make lots of people happy
Here's a screenshot:
PS 180 fps .. not bad
If you save your data in a proprietary format, the owner of the format owns your data.
<br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>
Bookmarks