In What Order Should I Send My Vertices To OpenGL for Culling

By default? In counter-clockwise order. Consider a triangle facing the camera: A |\ | \ | \ B—C A->B->C would be front facing (counter-clockwise order), A->C->B would be rear-facing (clockwise order). You can change which way OpenGL considers “front facing” via glFrontFace(): The projection of a polygon to window coordinates is said to have clockwise … Read more

Current state and solutions for OpenGL over Windows Remote [closed]

According to this article it seems that now RDP handles newer versions of Direct3D and OpenGL on Windows 10 and Windows Server 2016, but by default it is disabled by Group Policy. I suppose that for performance reasons, using a hardware graphics card is disabled, and RDP uses a software-emulated graphics card driver that provides … Read more

Why does valgrind say basic SDL program is leaking memory?

Even for basic OpenGL “hello world” program without the full SDL, Valgrind gives me similar warnings deep inside the OpenGL libraries. It’s peculiar, but I’ve assumed The library implementors know what they’re doing (probably preallocating some small static buffers they never bother to free), Even if they don’t, it’s a one-time leak that’ll be reclaimed … Read more

What is the point of an SDL2 Texture?

SDL_Texture objects are stored as close as possible to video card memory and therefore can easily be accelerated by your GPU. Resizing, alpha blending, anti-aliasing and almost any compute-heavy operation can harshly be affected by this performance boost. If your program needs to run a per-pixel logic on your textures, you are encouraged to convert … Read more

Xcode 5 crashes when running an app with SDL 2

It looks like the problem is that SDL2 isn’t properly signed. There’s a ticket to fix the issue at https://bugzilla.libsdl.org/show_bug.cgi?id=2058. When you spawn an application from Xcode 5 with lldb, Xcode loads a plugin that will inspect modules your application loads, presumably to give you insight into your program. Xcode is set up to crash … Read more

‘”SDL.h” no such file or directory found’ when compiling

For Simple Direct Media Layer 2 (SDL2), after installing it on Ubuntu 16.04 via: sudo apt-get install libsdl2-dev I used the header: #include <SDL2/SDL.h> and the compiler linker command: -lSDL2main -lSDL2 Additionally, you may also want to install: apt-get install libsdl2-image-dev apt-get install libsdl2-mixer-dev apt-get install libsdl2-ttf-dev With these headers: #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h> #include … Read more

Cannot infer an appropriate lifetime for autoref due to conflicting requirements

Here’s a smaller example that reproduces the problem: struct FontLoader(String); struct Font<‘a>(&’a str); impl FontLoader { fn load(&self) -> Font { Font(&self.0) } } struct Window; struct Phi<‘window> { window: &’window Window, loader: FontLoader, font: Option<Font<‘window>>, } impl<‘window> Phi<‘window> { fn do_the_thing(&mut self) { let font = self.loader.load(); self.font = Some(font); } } fn main() … Read more

How to use SDL2 and SDL_image with cmake

I think that the following will work, as it finds the libraries on my ubuntu system and the example function you provided can link: project(shooter-cmake2) cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=c++0x”) add_executable(${PROJECT_NAME} src/test.cpp) INCLUDE(FindPkgConfig) PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES}) If cmake is executed with –debug-output it outputs: — Found PkgConfig: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)