ferzkopp / sdl_gfx Goto Github PK
View Code? Open in Web Editor NEWCopy of https://sdlgfx.svn.sourceforge.net/svnroot/sdlgfx - maybe out of date! The SVN version IS the official release.
Home Page: http://www.ferzkopp.net
License: Other
Copy of https://sdlgfx.svn.sourceforge.net/svnroot/sdlgfx - maybe out of date! The SVN version IS the official release.
Home Page: http://www.ferzkopp.net
License: Other
Line 3968 in 0df23ee
This issue is only coming in Release mode not in Debug mode
I thought it might be due to VS 22 but the same issue is coming in VS 19
I'm asking this because I noticed the files of this project are different from the recent official ones on Ferzkopp webpage.
Hi,
I've searched here, on SourceForge and your site, but in none of the repos could I find an official way to submit a patch to SDL2_gfx. I've implemented a few basic gradient drawing primitives, and I think it might be useful to add them to the graphics primitives library. Where should I start if I'd like to contribute?
Thanks, Árpád
Hi. I'm unsure if this is an issue or if I'm using it wrong, but there is a call to SDL_RenderPresent()
at the end of texturedPolygonMT()
(gfxPrimitives, latest Feb 2017 release). This makes it impossible to use, as the renderer will render the polygons drawn with this function one by one, rather than rendering the whole frame at once.
The function rotozoomSurfaceXY()
appears to be using the zoomx
parameter for both horizontal and vertical scaling factor, incorrectly resulting in a behavior similar to rotozoomSurface()
. The correct behavior, according to the documentation, is to use zoomx
as horizontal scaling factor and zoomy
as vertical scaling factor.
I tested the behavior with SDL_gfx version 2.0.25.
Here is a test code (an image named "sample.bmp" is required):
/* When a non-zero angle is specified, the zoomy factor
* is ignored and zoomx is used as both horizontal and
* vertical scaling factor
* An image named "sample.bmp" is required. */
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_rotozoom.h>
int main(void)
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface* window = SDL_SetVideoMode(800, 600, 0, 0);
SDL_Surface* image = SDL_LoadBMP("sample.bmp");
SDL_Rect pos = {window->w/2, window->h/2};
int running = 1, flip=0;
float angle=0, zoomx=1, zoomy=1;
SDL_Event event;
while(running)
{
if(SDL_PollEvent(&event))
{
if(event.type == SDL_QUIT)
running = 0;
if(event.type == SDL_KEYDOWN)
{
switch(event.key.keysym.sym)
{
case SDLK_UP: pos.y -= 10; break;
case SDLK_DOWN: pos.y += 10; break;
case SDLK_LEFT: pos.x -= 10; break;
case SDLK_RIGHT: pos.x += 10; break;
case SDLK_r: angle += 1; break;
case SDLK_t: angle -= 1; break;
case SDLK_x: zoomx += 0.5; break;
case SDLK_z: zoomx -= 0.5; break;
case SDLK_q: zoomy += 0.5; break;
case SDLK_a: zoomy -= 0.5; break;
case SDLK_f: flip = 1; break;
case SDLK_g: flip = 2; break;
case SDLK_h: flip = 0; break;
default: break;
}
}
}
SDL_FillRect(window, NULL, 0);
SDL_Surface* transformedSurface = rotozoomSurfaceXY(
image,
angle,
(flip==1? -zoomx : zoomx),
(flip==2? -zoomy : zoomy),
SMOOTHING_OFF);
SDL_BlitSurface(transformedSurface, NULL, window, &pos);
SDL_FreeSurface(transformedSurface);
SDL_Flip(window);
}
return EXIT_SUCCESS;
}
Compiled with:
gcc main.c -o "test" `sdl-config --cflags --libs` -lSDL_gfx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.