小编Sam*_*art的帖子

GLSL着色器的正确文件扩展名是什么?

我正在学习glsl着色,我遇到了不同的文件格式.我见过人们给出他们的顶点和片段着色器.vert.frag扩展.但我也看到.vsh.fsh扩展,甚至两个着色器在一个.glsl文件中.所以我想知道是否有标准的文件格式,或者哪种方式是'正确的'?

opengl shader glsl

124
推荐指数
4
解决办法
5万
查看次数

使用AVPlayer在iphone上播放许多不同的视频

我正在使用AVFoundation为iOS定制视频播放器.我们的想法是能够通过手势切换到不同的视频(点按,滑动等等).现在玩家在模拟器上完美运行,但是当我在实际设备上测试时,在3或4次滑动后视图变为空白.我甚至为我的播放器创建了播放控件,当视图变为空白时,这些控件正确加载但什么都不做.有什么想法吗?这是播放器的初始化

            - (id)initWithContentURL:(NSString *)aContentURL delegate:(id)aDelegate {
        self = [super initWithNibName:@"NoCashMoviePlayer" bundle:nil];
        if (self == nil)
            return nil;
        delegate = aDelegate;
        systemPath = [aContentURL retain];
        contentURL = [[NSURL alloc]initFileURLWithPath:systemPath];
        asset = [AVURLAsset URLAssetWithURL:contentURL options:nil];
        playerItem = [AVPlayerItem playerItemWithAsset:asset];
        isPaused = false;
        controlsHidden = false;
        self.player = [[AVPlayer playerWithPlayerItem:playerItem] retain];
         duration = self.player.currentItem.asset.duration;

        return self;
    }
Run Code Online (Sandbox Code Playgroud)

这是播放视频的代码:

    -(void)playMovie{

        UITapGestureRecognizer *tapRecon = [[UITapGestureRecognizer alloc]initWithTarget:self   action:@selector(toggleControls:)];
        [tapRecon setNumberOfTapsRequired:2]; 
        [self.movieContainer addGestureRecognizer:tapRecon];
        [tapRecon release];

        NSLog(@"Playing item: %@",contentURL);
        playerLayer = [AVPlayerLayer playerLayerWithPlayer:player];
        [movieContainer.layer addSublayer:playerLayer];
        playerLayer.frame …
Run Code Online (Sandbox Code Playgroud)

iphone xcode avfoundation media-player ipad

5
推荐指数
1
解决办法
1万
查看次数

iOS主页按钮警告,是否可能?

我真的不认为这可以做到,但我的老板还是希望我提供一个链接.他想要的是添加'你确定要退出吗?' 当用户按下主页按钮时发出警告,如果用户说"不",则应用程序将不会变为非活动状态.它不能做,可以吗?

iphone ipad ios

5
推荐指数
1
解决办法
4884
查看次数

为什么不支持AIR NativeProcess?

我正在使用Flash Builder构建一个桌面应用程序,我需要它来运行.exe程序.我下载并安装了最新的AIR SDK,将它放在我的Flash Builder sdks文件夹中并让我的项目使用它.现在我没有任何编译器错误,但是:

     if(NativeProcess.isSupported)
            {
                var file:File = new File("C:\Torres.exe");
                var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
                nativeProcessStartupInfo.executable = file;
                var process:NativeProcess = new NativeProcess();
                process.start(nativeProcessStartupInfo);
            }
Run Code Online (Sandbox Code Playgroud)

我检查了它,它永远不会进入if块.为什么不支持nativeprocess?有任何想法吗?

apache-flex air actionscript

4
推荐指数
1
解决办法
6817
查看次数

如何在 C# 中获取 Mac OSX 当前用户的目录?

现在我有:

s = @"/Users/minisquad1/Pictures/";
Run Code Online (Sandbox Code Playgroud)

这在我的电脑上运行得很好。如果我可以访问当前用户的图片文件夹,我会感到更安全,因为现在它显然只能在我的计算机上使用。

我不知道该怎么做,有人有想法吗?我正在寻找类似的东西:

s = @"/Users/%currentuser%/Pictures/";
Run Code Online (Sandbox Code Playgroud)

如何才能做到这一点?

c# macos

3
推荐指数
1
解决办法
3512
查看次数

我可以直接加载iOS应用程序而无需越狱设备吗?

好吧,首先,我不是要做任何违法行为,我也是一个iOS开发者,我讨厌那些偷我们努力工作的人.我想知道是否有一种方法可以在iOS设备上安装配置文件而不是使用苹果的配置门户,或者更好的是,安装我的一个应用程序而没有配置文件而没有JAILBREAKING.问题是,我为客户开发了一个定制的应用程序,他们没有事先告诉我,它必须安装在50个设备上.他们需要在下周准备好这些设备,因此没有时间在应用程序商店上传应用程序,并且由于苹果每年有100个开发设备策略,我无法将我的所有50个客户端设备上传到我的配置门户.但是,他也不希望我越狱他的设备.

那么,我该怎么办?我刚搞砸了吗?

iphone ipad ios

2
推荐指数
1
解决办法
1835
查看次数

有没有办法在"静默"中读取ActionScript 3中的本地文件?

我正在开发一个应用程序,由于某些设计限制,我必须在Flash中进行.这个应用程序与在c ++中完成的另一个应用程序通信,但仅仅因为我需要一些字符串,所以我认为将它们写入.txt文件并解析它会很容易.但到目前为止我找到的唯一方法是添加一个浏览事件处理程序并手动选择该文件.这对我没有好处,我需要在给定路径的情况下自动读取文件,例如:

        var data:ByteArray = fileRef['C:\whateverPath'];
        var loader:Loader = new Loader();
        loader.loadBytes(data);
Run Code Online (Sandbox Code Playgroud)

甚至可以这样做吗?

filesystems flash actionscript actionscript-3

2
推荐指数
1
解决办法
6145
查看次数

获取系统IO的文件名

我正在研究一个C#脚本,它必须在运行时访问一个随机文件,问题是文件是由其他来源动态生成的,我无法知道他们的名字,我已经解决了第一个问题是获取我的工作目录中有多少文件:

            s = @"C:\Imagenes";
            System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(s);
    int files;
    files = d.GetFiles().Length;
    Debug.Log(files.ToString());
    return files;
Run Code Online (Sandbox Code Playgroud)

现在我想在我的工作指南中访问一个随机元素,但由于我不知道他们的名字是什么,有没有办法通过索引或其他东西得到他们的名字?

c# file-io

0
推荐指数
1
解决办法
2290
查看次数