Giter Site home page Giter Site logo

opendingux / sdl Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 11.0 47.58 MB

SDL 1.2 repository with patches for OpenDingux

License: GNU Lesser General Public License v2.1

HTML 0.59% Makefile 0.20% C 81.53% Shell 4.23% Rich Text Format 0.19% C++ 7.65% Objective-C 3.79% M4 0.34% Assembly 1.34% R 0.08% Logos 0.05% Perl 0.01%

sdl's People

Contributors

3v1n0 avatar bavison avatar ccawley2011 avatar ferzkopp avatar glebm avatar icculus avatar johnnyonflame avatar pcercuei avatar phlamethrower avatar pmandin avatar ppisar avatar senquack avatar sezero avatar slime73 avatar slouken avatar vinriviere avatar winterheart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sdl's Issues

rg99 fails to switch video modes

I've managed to reproduce the error with a very simple program:

#include <stdio.h>

#include <SDL.h>

int main(int argc, char **argv) {
  if (SDL_Init(SDL_INIT_VIDEO) <= -1) {
    printf("%s\n", SDL_GetError());
    return 1;
  }

  for (unsigned i = 1; i <= 100; ++i) {
    printf("Iteration: %u\n", i);

    printf("SDL_SetVideoMode(320, 480, 8, SDL_FULLSCREEN|SDL_HWSURFACE)\n");
    if (SDL_SetVideoMode(320, 480, 8, SDL_FULLSCREEN | SDL_HWSURFACE) == NULL) {
      printf("Failed to switch video modes: %s\n", SDL_GetError());
      return 1;
    }
    SDL_FillRect(SDL_GetVideoSurface(), NULL, 0);
    SDL_Flip(SDL_GetVideoSurface());

    printf("SDL_SetVideoMode(640, 480, 8, SDL_FULLSCREEN|SDL_HWSURFACE)\n");
    if (SDL_SetVideoMode(640, 480, 8, SDL_FULLSCREEN | SDL_HWSURFACE) == NULL) {
      printf("Failed to switch video modes: %s\n", SDL_GetError());
      return 1;
    }
    SDL_FillRect(SDL_GetVideoSurface(), NULL, 0);
    SDL_Flip(SDL_GetVideoSurface());

    SDL_Event event;
    while (SDL_PollEvent(&event)) {
      if (event.type == SDL_QUIT) {
        printf("Force quitting\n");
        return 1;
      }
    }
  }

  printf("Quitting\n");
  SDL_Quit();
  return 0;
}

This takes a few iterations to fail. In a real program that does a lot more (DevilutionX), the failure happens on the 3rd call to SDL_SetVideoMode.

The underlying reason appears to be a DRM memory leak, because when it fails, it is because DRM_IOCTL_MODE_CREATE_DUMB returns:

Dumb framebuffer request failed, Out of memory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.