New answers tagged

0

See Do I really need to use a graphics API? Sure, you can ask for a buffer, set some bits in it and write it to the screen. That was essentially the only way to do graphics programming on the PC until the availability of graphics accelerators in the mid-90s from 3DFX. Even in Windows, DirectX was developed to give direct access to video memory. But on ...


2

The above answers are excellent, but none really goes over the most important reason as to why OpenGL and such are preferred. The main reason is to make use of dedicated hardware designed especially to work with things like rendering millions of pixels on a screen, the GPU. With software rendering, using the CPU, the renderer will be looping, one by one, ...


6

While the answers from others are more correct than any answer I could give, I want to point out the fundamental misunderstanding about how software development works that I think underlies your question. While it's always possible to do things "by yourself" without a framework, and there's often great educational benefit from doing so, the reality is that's ...


37

It's not just about speed of execution, but also about simplicity. Although the software rendering used in this example would be a lot slower than using hardware acceleration (i.e. a GPU), drawing a few bitmaps on screen is such a trivial task that you would not notice the performance drop. However, low-level activity like triangle rasterisation, depth sort ...


11

What he does is called software rendering, what OpenGL does is called GPU rendering What's the difference between them? Speed and memory. Rasterization (filling out triangles on screen) takes some time. If you do it on the CPU, you essentially take that time away from game logic, especially if it's not optimized well. And doesn't matter, how small the ...


24

My question is: why even bother using something like open gl, sfml, sdl when all you have to do is simply allocate some buffer, pass a bitmap and draw it to the screen? Short: Because its fast (OpenGL, DirectX). Long: You may think you can do this all yourself. Draw pixels to a screen. You might write a small library to draw shapes, like quads or ...


3

Engines do much more that just draw a picture to the screen. They handle lighting, shadows, input , collision detection. Even just the rendering part is way more complex than just pushing a buffer onto the screen. For 3d scenes especially you need to do a lot of calculations on far more complex data than a bitmap. Let me give you a analogy with a car: What ...


2

It looks like the edges get a fractional alpha based on the edge coverage. Problem arises when two edges fill 100% together but are blended as translucency, not coverage, only applying ~75% color. It's like the difference between covering your eyes with both hands vs covering your eyes with two pair of sunglasses. I only know how this works in opengl, but ...


1

I've stumbled on an answer for creating a decent and easy GUI system from playing around with my game. Currently it draws the images of items onto the GUI screen, but more can be done in the future. This is essentially how I have it setup: Over-World State: EntityPlayer {picks up} --> Item (i.e. ItemPotion) --> {goes to} Player Inventory The Player walks ...



Top 50 recent answers are included