Flash | 23 Oct 21:07 2014
Picon

Texture Repeat

Hi, is there any way to easily repeat a texture on specified area, without using GL's functions? I need portable method that can also be used with DX.
Normally i would use loop, but it's just *ugh* when both dx (D3DTADDRESS_WRAP) and ogl (GL_REPEAT) just have it.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
DLudwig | 23 Oct 19:59 2014
Picon

Re: SDL2 downward compatibility








Meldryt wrote:
So my question is, if its possible to develop on SDL2.0.3 and compile this code on my WinRT project with the current SDL version without getting errors.


It's probably possible. I don't recall seeing anything introduced since SDL 2.0.3's release that'd cause problems. I have SDL/WinRT-utilizing app projects that I haven't touched in a long while, outside of changing internal path references (to SDL/WinRT's MSVC projects), that work fine with the latest SDL code + project files.

Maybe give it a shot, and if it starts failing, post back with details?

Cheers,
-- David L.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Kyle Noteboom | 23 Oct 19:44 2014
Picon

"multiple definition of `main'" when compiling application with MinGW w64

I'm trying to compile a simple application which consists of initializing SDL, and then shutting down.
The compiler I'm using is MinGW w64: x86_64-4.9.1-posix-seh-rt_v3-rev1.7
The meat of the error CLion spits out is this:

D:\Programming\Projects\CLion\OpenGL\Libraries\SDL2-2.0.3\lib\x64\SDL2main.lib(./x64/Release/SDL_windows_main.obj):(.text[main]+0x0): multiple definition of `main'
D:/Software/Programs/MinGW/w64/x86_64-4.9.1-posix-seh-rt_v3-rev1.7/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x0): first defined here

I've made a Gist containing my code, the build log, CMakeLists.txt and FindSDL2.cmake here: https://gist.github.com/anonymous/5c4b9c2c42a4e3db4357

What can I do to get this to compile? Am I using a wrong version of MinGW w64? Or am I not linking correctly?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
brada | 23 Oct 03:16 2014

Re: Memory leak in ShowMessageBox?








Quote:
is there a reason why the message box feature should cause the application's memory usage to ascend without ever coming back down


it could be as simple as the memory manager (heap manager?) deciding its more efficient to let the process retain ownership of the memory in case it needs to do more allocations. if your system were starving for memory it probably would return the memory to the system. There are other reasons too I think, but really the point is that tests like this can often indicate leaks, but to actually know you should use a tool designed for detecting leaks (Valgrind). Operating systems are big complicated beasts where processes are caching things, getting messages from other processes, and who-knows-what-else without you (as both a user and a programmer) being aware.








Quote:
I would suspect this has gone unnoticed due to the fact that a real-world need to show thousands of message boxes during the course of a multimedia application's lifetime


maybe. I cant testify to what the SDL team does, but if they are regularly probing for leaks then all it takes is a single tiny leak to spot this. Of course that assumes they have a test which incorporates a message box. I havent checked out SDLs test suite, but I hear its pretty extensive. However, message boxes probably contain a fair amount of platform dependent code, so maybe it only leaks for Windows as you suggest.

As I said before, I'm not saying there isn't a leak, just that somebody is going to have to fire up a Valgrindesque tool and check to both determine if there is one, and find what and where it is leaking.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
brada | 22 Oct 19:28 2014

Re: Memory leak in ShowMessageBox?

I'm not saying there *isn't* a leak, but the method you took to arrive at that conclusion is flawed.

Now I'm not a "Windows" guy, but I think its true for any OS that there are any number of non-leaky reasons why memory usage doesnt recede back to ~1.3. You need to use an actual profiling tool like Valgrind to check for actual leaks.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Noxalus | 22 Oct 10:31 2014
Picon

SDL2 on Android get "Open with" arguments

Hello everyone!

I have an SDL 2.0 application that will load a file provided by another application (like Dropbox for instance) thanks to "Open with" dialog.

But I don't know how retrieve the argument given to my app from the other application. On iOS, for the exact same problem, I had to use SDL_DROPFILE event, but it doesn't seem to work the same way for Android.

I looked at SDLActivity.java to find some clue, but I didn't find anything.

Do you know how to do that?

Thanks in advance
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
LRFLEW | 16 Oct 04:24 2014
Picon

An obnoxious bug in SDL 1.2 and the workaround I found

There's an odd bug in SDL 1.2(.x) that affects a small number of users. If you are using a mac (on Mac OS X) that has dynamic graphic card switching on, then fullscreen windows will not present properly. While I had trouble finding an official bug report for SDL, I did find a few bug reports on specific games related to this bug such as this one. I could not find the source of this bug until I found this forum page that suggested disabling dynamic graphic card switching. After testing it, I was able to confirm that it did prevent the bug from appearing. From what I can tell, the bug occurs because SDL 1.2 is setting some part of the video mode before the dedicated GPU kicks in. This means that it tries to display using the integrated GPU and bugs out when the OS switches graphics cards.

While I still don't know where the bug actually occurs (so I can't actually fix it), I do know a workaround that is effective. While testing the bug, I noticed that calling SDL_SetVideoMode twice with the same arguments causes it to work fine. This makes sense, as the first call changes the graphics card and the second call actually sets up the display. With that knowledge, I devised the strangest patch. In the source for SDL_SetVideoMode, right before the last return statement (about line 920), I added the following two lines:








Code:
if ( (flags & SDL_FULLSCREEN) && !(strcmp(video->name, "Quartz")) && !(flags & 0x00080000) )
        return SDL_SetVideoMode(width, height, bpp, flags | 0x00080000);


Yes, it's not the most elegant solution, but it *does* work. Maybe if someone with more experience with Quartz and Macs worked on this, we could have an actual fix. In the meantime, this at least fixes the games that were affected by this.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
JohnB | 17 Oct 21:01 2014
Picon

Anyone got SDL2 working with GPG-CPP-SDK?

My native method isn't being found by the Java end

My subclass of Activity has:








Code:
package com.dumbdumber.myproject;

public class SubActivity extends SDLActivity {//which extends Activity

    private static native void nativeInitGPGS(SubActivity act);

    <at> Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        nativeInitGPGS(this);
    }


While main.cpp begins, after first preprocessing directives:








Code:
extern "C"
{
JNIEXPORT void
Java_com_dumbdumber_myproject_SubActivity_nativeInitGPGS(JNIEnv* env, jobject thiz, jobject activity)
{


I get:

10-17 16:12:38.051: D/dalvikvm(4980): Trying to load lib /data/data/com.dumbdumber.myproject/lib/libmain.so 0x423849c8
10-17 16:12:38.055: D/dalvikvm(4980): Added shared lib /data/data/com.dumbdumber.myproject/lib/libmain.so 0x423849c8
10-17 16:12:38.060: V/SDL(4980): onCreate():null
10-17 16:12:38.087: W/dalvikvm(4980): No implementation found for native Lcom/dumbdumber/myproject/SubActivity;.nativeInitGPGS:(Lcom/dumbdumber/myproject/SubActivity;)V
10-17 16:12:38.108: D/AndroidRuntime(4980): Shutting down VM
10-17 16:12:38.108: W/dalvikvm(4980): threadid=1: thread exiting with uncaught exception (group=0x41b73908)
10-17 16:00:52.456: E/AndroidRuntime(4699): FATAL EXCEPTION: main
10-17 16:00:52.456: E/AndroidRuntime(4699): java.lang.UnsatisfiedLinkError: Native method not found: com.dumbdumber.myproject.SubActivity.nativeInitGPGS:(Lcom/dumbdumber/myproject/SubActivity;)V
10-17 16:00:52.456: E/AndroidRuntime(4699): at com.dumbdumber.myproject.SubActivity.nativeInitGPGS(Native Method)
10-17 16:00:52.456: E/AndroidRuntime(4699): at com.dumbdumber.myproject.SubActivity.onCreate(SubActivity)

I believe the native implementation can be placed anywhere and automagickly picked up. I've tried placing the C implementation in another cpp body, instead of main.cpp but nothing changes.

Here is my Android.mk








Code:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := main

SDL_PATH := ../SDL

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include

LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
                    main.cpp
#Other stuff removed for clarity

LOCAL_SHARED_LIBRARIES :=   SDL2_image \
                            SDL2    \
                            SDL2_ttf
LOCAL_WHOLE_STATIC_LIBRARIES += gpg_static

LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lz

include $(BUILD_SHARED_LIBRARY)

While I leave loading of the shared libraries to SDLActivity

static {
    System.loadLibrary("SDL2");
    System.loadLibrary("SDL2_image");
    System.loadLibrary("SDL2_ttf");
    System.loadLibrary("main");
}


I've remembered to run ndk-build (twice) in the jni directory and am attempting to run on my phone.

I've run my libmain.so through a hexeditor and can confirm it exists, also here's the first six lines output from nm from the NDK








Code:

        U IMG_Init 
        U IMG_Load 
        U IMG_Quit 

    00065454 T JNI_OnLoad
    0005c208 T Java_org_libsdl_app_SDLActivity_nativeInit
    0006851c T Java_com_dumbdumber_myproject_SubActivity_nativeInitGPGS
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Dw77 | 16 Oct 07:07 2014
Picon

Question about SDL Haptics and Windows

It has been a long time since I last used SDL, so imagine my surprise when I decide to see what's new and I Find SDL 2.0 complete with support for haptic feedback. Now I've had a USB HID Controller for a while now. However I came away disappointed when I tried to implement rumble with the controller after I used the Dpad Buttons and analog sticks. So onto my questions: Are the haptic capabilities unimplemented or only partially implemented? If it is only implemented through Xinput is there a timetable for DirectX Support?

If none of this is actually relevant then it sounds like it is something with my controller so I include some information on it below:
OS: Windows 7 home
Computer HP Pavillion g6
Controller: Power A Airflo controller for PS3
it has 2 different devie functions listed under properties:
HID-compliant game Controller
USB Input Device

Some Further Information under the controller function:

HID-Compliant game controller Properties:
Hardware IDs:
HID\VID_20D6&PID_571D&REV_0100
HID\VID_20D6&PID_571D
HID_DEVICE_SYSTEM_GAME
HID_DEVICE_UP:0001_U:0005
HID_DEVICE
Device Class GUID: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Physical device object name: \Device\0000010e
Capabilities:
000000E0
CM_DEVCAP_SILENTINSTALL
CM_DEVCAP_RAWDEVICEOK
CM_DEVCAP_SURPRISEREMOVALOK
Power Data:
Current power state:
D0
Power capabilities:
0000005D
PDCAP_D0_SUPPORTED
PDCAP_D2_SUPPORTED
PDCAP_D3_SUPPORTED
PDCAP_WAKE_FROM_D0_SUPPORTED
PDCAP_WAKE_FROM_D2_SUPPORTED
Power state mappings:
S0 -> D0
S1 -> D2
S2 -> D2
S3 -> D2
S4 -> D2
S5 -> D3
Device instance path: HID\VID_20D6&PID_571D\7&29394B3F&1&0000
DevNode status:
0180200A
DN_DRIVER_LOADED
DN_STARTED
DN_DISABLEABLE
DN_NT_ENUMERATOR
DN_NT_DRIVER
Parent: USB\VID_20D6&PID_571D\6&16c176e9&0&1
Driver assembly version: 6.1.7601.18199

Thank you for any help
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
almightyj | 19 Oct 03:47 2014

Installing SDL2, getting "SDL_Texture does not name a type"

Have been racking my brain over the last week trying to get this to work. I am a noob so forgive any obvious things I missed.

First, I am using Ubuntu 12.04 LTS and couldn't find any packages I could install, so I downloaded the source and compiled the SDL2 library. When I check, it looks like the headers have been installed in the /usr/local/include directory and the .so files were installed in /usr/local/lib.

I am using Code::Blocks and added the following to the Project Build options:

Search Directories --> Compiler: /usr/local/include
Search Directories --> Linker: /usr/local/lib
Search Directories --> Resource Compiler: /usr/local/include and /usr/local/lib
Linker Settings --> Other linker options: -SDL2main -lSDL2

In my source code I have the following include statement:

#include

I'm pretty sure I'm at least pointing to the right place because if I change it, it gives me a "No such file or directory" error instead.

When it comes time to compile, it hits the first line I declare an SDL_Texture object, raising an error that "SDL_Texture does not name a type".

My understanding is that this error usually means that the referenced object is not defined elsewhere. I just migrated from using SDL 1.2 and switched all my SDL_Surfaces to SDL_Textures, but I thought that by including the SDL.h file, it included all the object definitions, so I'm at a loss.

Here is the excerpt from my header file raising the error: "SDL_Texture does not name a type"

#ifndef _CSURFACE_H_
#define _CSURFACE_H_

#include

class CSurface {
public:
CSurface();
int X;
int Y;

public:
//static SDL_Surface* OnLoad(char* File);
static SDL_Texture* OnLoad(char* file);
and here are the file listings where my compiled SDL2 files are.

/usr/local/include/SDL2:

SDL.h
SDL_assert.h
SDL_atomic.h
SDL_audio.h
SDL_bits.h
SDL_blendmode.h
SDL_clipboard.h
SDL_config.h
SDL_cpuinfo.h
SDL_endian.h
SDL_error.h
SDL_events.h
SDL_filesystem.h
SDL_gamecontroller.h
SDL_gesture.h
SDL_haptic.h
SDL_hints.h
SDL_joystick.h
SDL_keyboard.h
SDL_keycode.h
SDL_loadso.h
SDL_log.h
SDL_main.h
SDL_messagebox.h
SDL_mouse.h
SDL_mutex.h
SDL_name.h
SDL_opengl.h
SDL_opengles.h
SDL_opengles2.h
SDL_pixels.h
SDL_platform.h
SDL_power.h
SDL_quit.h
SDL_rect.h
SDL_render.h
SDL_revision.h
SDL_rwops.h
SDL_scancode.h
SDL_shape.h
SDL_stdinc.h
SDL_surface.h
SDL_system.h
SDL_syswm.h
SDL_test.h
SDL_test_assert.h
SDL_test_common.h
SDL_test_compare.h
SDL_test_crc32.h
SDL_test_font.h
SDL_test_fuzzer.h
SDL_test_harness.h
SDL_test_images.h
SDL_test_log.h
SDL_test_md5.h
SDL_test_random.h
SDL_thread.h
SDL_timer.h
SDL_touch.h
SDL_types.h
SDL_version.h
SDL_video.h
begin_code.h
close_code.h

/usr/local/lib:
libSDL2-2.0.so.0
libSDL2-2.0.so.0.2.1
libSDL2.a
libSDL2.la
libSDL2.so
libSDL2_test.a
libSDL2main.a
ocaml
pkgconfig
python2.7
site_ruby

Not sure if it didn't compile correctly, not sure if I have to manually include all the related SDL headers (I didn't have to do that on SDL 1.2), not sure if I'm missing something in my linker instructions.

Help!
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex Dănilă | 17 Oct 11:09 2014
Picon

SDL 2 - keyboard focus on Windows 8.1 PC

Hi,

Using SDL2-widgets together with SDL 2.0.4 I can't get any keyboard events.

Assuming this is a focus problem I tried constructing XAML controls as swapChainPanel children that stretched over its entire area, or the other way around, make the swapChainPanel a child. No matter what configuration, the application behaves exactly the same, and gets only mouse events.

What could be the problem and what could I have missed about using SDL2 on Windows 8.1?

Thanks
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Gmane