Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: iOS specific features and Vulkan support  (Read 3151 times)

0 Members and 1 Guest are viewing this topic.

jax

  • Newbie
  • *
  • Posts: 3
    • View Profile
iOS specific features and Vulkan support
« on: May 15, 2020, 06:15:08 pm »
Hi all,

I have two questions with more detail below:
1. How to handle Apple dropping OpenGL in the future.
2. How to support IAPs for iOS games made with SFML.

I've been developing a game using SFML for a bit. The game was originally built in another engine and is currently available for download since 2012, but I needed to update it to support newer devices and decided to use SFML for that purpose.

I've managed to get builds working on Windows, Mac, and iOS and it works great.

I've only recently noticed that Apple plans on dropping OpenGL support, so I was curious what that means for the future of SFML.

I checked the github and saw that Vulkan support was being added. Is it in a usable state? Can it be used with MoltanVK? (https://github.com/KhronosGroup/MoltenVK).

My 2nd question is how can I integrate platform specific features into my SFML application? Admittedly I've always used engines that supported this out of the box, but I couldn't find anything for SFML.

Thanks in advance for any help!

jax

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: iOS specific features and Vulkan support
« Reply #1 on: May 17, 2020, 09:26:16 pm »
Quick update.

Figured out how to accomplish 2, and just in case someone finds this via Google in the future here is what I did:

I made iOSExtensions.hpp with the following:

Quote
#ifndef IOS_EXTENSIONS_HPP
#define IOS_EXTENSIONS_HPP

#include <string>

void ios_popup(std::string title, std::string msg);

#endif

And then to implement the function using Objective-C++ created iOSExtensions.mm

Quote
#include "iOSExtensions.hpp"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

void ios_popup(std::string title, std::string msg)
{
    NSString *ns_title = [NSString stringWithCString:title.c_str()
    encoding:[NSString defaultCStringEncoding]];
    NSString *ns_msg = [NSString stringWithCString:msg.c_str()
    encoding:[NSString defaultCStringEncoding]];
   
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:ns_title
                                                      message:ns_msg
                                                     delegate:nil
                                            cancelButtonTitle:@"Ok"
                                          otherButtonTitles:nil];
    [alert show];
}

And for the first question I found the following OpenGL ES -> Metal translation layer, so I'm going to attempt to compile SFML with it:
https://github.com/kakashidinho/metalangle