Graphics module
BlitzMax Forums/BlitzMax Beginners Area/Graphics module
| ||
I am not very advanced programmer with Blitzmax. Which graphics module you recommend for me? If I use one, is it easy to turn my codes to .exe files? Can my include my images and music to the .exe file? |
| ||
use opengl. and use 'IncBin' command. |
| ||
I thought slightly higher level module than opengl. And what I mean by that, assembly and C++ are lower level than Blitzmax. Last edited 2010 |
| ||
then you need to make own gfx module.. |
| ||
Haven't somebody done it already? |
| ||
whats wrong brl modules (openGL,Directx7,DirextX9)?? |
| ||
Well, maybe I have to start to learn OpenGl. Am I right, does blitzmax support OpenGl or do I have to import module for it? I am quite new with these things. |
| ||
if you speak finnish then i may help you with Email. |
| ||
Don't give him confusing advice. jankupila, BlitzMax comes with OpenGL and DirectX 2d graphics as standard. You don't need another module or to use OpenGL directly. Here is an example SetGraphicsDriver GLMax2DDriver() Graphics 640, 480 SetColor 255, 0, 0 DrawRect 50, 50, 100, 100 SetColor 0, 255, 255 DrawOval 400, 100, 50, 50 SetColor 255, 255, 0 DrawText "Drawing graphics!", 300, 300 Flip WaitKey() When you run your program, an exe is automatically made for you in the same folder as your source code file. You can run this independantly of BlitzMax. |
| ||
I speak Finnish and I take advice more than happily. |
| ||
I would like to have a link for good OpenGL tutorial. |
| ||
You do not need an OpenGL tutorial, you only need a BlitzMax tutorial. Using OpenGL/DirectX is transparent in BlitzMax. Simply set the driver and there is no API specific code required as long as you are using BM's syntax. |
| ||
http://www.cs.uccs.edu/~semwal/indexGLTutorial.html |
| ||
"I thought slightly higher level module than opengl." As GaryV says above, you should start with BlitzMax Max2D module which is higher level and much simpler than OpenGL. |
| ||
_Skully, thanks for the link. Last edited 2010 |
| ||
I figured it out how to use Incbin, here is small example for those who are not familiar with it.Strict Incbin "D:\kuva-library\hahmoja\face002.png" 'put here your image Graphics 800,600 Local img:TImage = LoadImage("incbin::D:\kuva-library\hahmoja\face002.png") 'and same to here. While Not KeyDown(key_escape) Cls DrawImage img,MouseX(),MouseY() Flip Wend Last edited 2010 |
| ||
Tip: I don't think it really makes a difference when you are using incbin, but in general it's a bad idea to use absolute paths. Use relative paths, which don't depend on a specific computer configuration to work. e.g. put your images inside of a subfolder under your application folder itself, and you can then load the image as "images\face002.png" (or "incbin::images\face002.png") The advantage of that is that you don't have a dependency on the d:\ drive in the mix, allowing you to move the folder to different locations altogether, or be able to function on a computer that doesn't have a D:\ drive at all) |
| ||
Well, maybe I have to start to learn OpenGL Am I right, does blitzmax support OpenGl or do I have to import module for it? I am quite new with these things. You don't have to learn any OpenGL. Blitzmax works with OpenGL automatically for you. Paying money for Blitzmax just to write OpenGL with it kind of defeats the point of buying it.Here is a good tutorial on getting starting with Blitzmax: http://www.2dgamecreators.com/tutorials/gameprogramming/index.html |
| ||
Ok thanks :) I am now familiar with oop, types and Tlist. Last edited 2010 |